emikey emikey
  • 20-10-2017
  • Computers and Technology
contestada

I am having trouble figuring out how to write a while loop in Python. Can someone help me?

Respuesta :

zrh2sfo
zrh2sfo zrh2sfo
  • 20-10-2017
#!/usr/bin/python
 
count = 0
while (count < 9):
    print 'The count is:', count
   count = count + 1

print "Goodbye!"

The output should look like this:
The count is: 0
The count is: 1
The count is: 2
The count is: 3
The count is: 4
The count is: 5
The count is: 6
The count is: 7
The count is: 8
Goodbye!


Answer Link

Otras preguntas

which armies had increased in size between 1870 and 1914
One half of the birds at the pet store are yellow. Tara buys one of the yellow birds. Then one third of the birds at the store are yellow. How many yellow birds
An art teacher has 9 students in a pottery class. He has 21.06 pounds of clay he divides evenly among all the students. Each student will divide his or her clay
A sentence using the word misfortune
how is the thermal energy of a substance related to its physical state
In meters, the sides of a triangle measure 14,18 and 12. The length of the longest side of a similar triangle is 21 meters. a. Find the ratio of similitude of
What is the mean value 268,1258,900,and 654?
how is the thermal energy of a substance related to its physical state
The world's fastest insect is the dragonfly,which can fly upto 36 miles per hour.At this rate,how long would t take a dragonfly to travel 54 miles?
At a speed of 22 revolutions per minute, how long will it take a wheel of radius 10, rolling on its edge, to travel 10 feet? (Assume p equals 22/7, and express