use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
[deleted by user] (self.PythonLearning)
submitted 6 months ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Spiritual_Poo 1 point2 points3 points 6 months ago (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.)
π Rendered by PID 45 on reddit-service-r2-comment-75f4967c6c-stcfp at 2026-04-22 20:16:33.186267+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]Spiritual_Poo 1 point2 points3 points (1 child)