[Tutor] Print/Loop Question
bgailer at gmail.com
Thu Mar 17 20:13:58 CET 2011
On 3/17/2011 1:19 PM, Jeff Goodwin wrote:
> I'm trying to run the below program and get it to print out feedback
> as the loop goes. However, if you enter a number too high or too low,
> it skips the print statement under the if and elif clauses and asks
> the user to "Guess a number between 1-100" again. Any suggestions on
> how to get it to print the "too high" and "too low" responses?? Once
> the number is entered correctly it prints "Just Right" and exits
> number = 44
> while guess != number :
> guess = int(raw_input("Guess a number between 1 - 100: "))
> *if* guess > number :
> *print* ("Too high")
> *elif* guess < number :
> *print* ("Too low")
> *print* ("Just right" )
That program is not the one you ran!
Something is missing!
Please also inform us:
How you run the program.
Be sure to Reply-All so a copy goes to the list.
Chapel Hill NC
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor