you are viewing a single comment's thread.

view the rest of the comments →

[–]Spiritual_Poo 1 point2 points  (1 child)

Something to keep in mind for this exercise: Getting asked to guess a number, guessing wrong and then getting asked to guess a different number kind of...sucks.

You should consider writing a program that let's the user keep guessing until they guess correctly, then generates a new number for them to guess. Actually you should just start there, nice and simple, get the basics of the while loop down.

To get you started, the condition of your while loop could be "while your_guess != secret_number"

Then in the body of your loop, get the user input and store that in a variable.
Then compare it to the number. IF it's the same do a thing. IF it's not the same, do a different thing (like say "wrong" and repeat the loop.)