[Tutor] while loop problem

mustafa akkoc mustafa.cmpe at gmail.com
Sun Mar 8 18:56:15 CET 2009


hello i have syntax problem in this program
#!/usr/bin/python
# Filename: while.py
number = 23
running = True

while running :
guess= input('Enter an integer : ')  # it give a syntax error this line can
you me ?

if guess == number:
print('Congratulations, you guessed it.')
running = False # this causes the while loop to stop

elif guess < number:
print('No, it is a little higher than that.')

else:
print('No, it is a little lower than that.')

else:
print('The while loop is over.')

# Do anything else you want to do here
print('Done'


-- 
Mustafa Akkoc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090308/bd5327c1/attachment-0001.htm>


More information about the Tutor mailing list