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

In a series circuit, there are 12 light bulbs, each providing 1 ohm of resistance. What is the total resistance? Group of answer choices
Can anyone prove this identity? Thank you.
federal funding accounts for approximately ____ of budget for the criminal justice system in the united states quizlet
Which type of work is an electrical engineer most likely to do? Which type of work is an electrical engineer most likely to do? A. create materials for electri
What’s the answer for the formula question
Which of the following is NOT approximately equivalent to one of the metric units
a post office charges 50k for a telegram of 15 words or less it charges an extra 3k for every word above 15 words find the cost of 30 words telegram​
PLEASE HELP ME W THIS QUESTION!!
Which inequality is shown in the graph? A. y=x^2 - 5 B. Y _> x^2 +5 С. Y _> x^2 - 5 D. Y_< x^2 -5
what is a measure of force that is equal to the gravitational pull on an object ?