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 correctly.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") *else*: *print* ("Just right" )
That program is not the one you ran! Something is missing! Please also inform us: Python Version Operating System How you run the program. Be sure to Reply-All so a copy goes to the list. -- Bob Gailer 919-636-4239 Chapel Hill NC
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
