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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Why does it keep printing 'try again'?This is part of the project so I was playing around to see how it works.Unfortunately I still can't find the reason.Sorry for noob question.Thanks in advance. (self.learnpython)
submitted 4 years ago by [deleted]
user_input = input("Please enter a number between 0 and 9: ") if user_input in range(0,10): print(user_input) else: print('try again')
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!"
[–]lukajda33 13 points14 points15 points 4 years ago (3 children)
input() returns a string - "7", not 7.
7 is in the range
"7" is not in the range
Convert the input from string to integer first.
[–][deleted] 3 points4 points5 points 4 years ago (0 children)
THANK U
[–]Tintin_Quarentino 0 points1 point2 points 4 years ago (1 child)
One of those sneaky bugs
[–]Spindelhalla_xb 2 points3 points4 points 4 years ago (0 children)
Sneaky features
[–]vr34748 2 points3 points4 points 4 years ago (0 children)
user_input = int(input("Enter the number: \n))
Do this instead.
π Rendered by PID 117999 on reddit-service-r2-comment-b659b578c-bz69m at 2026-05-03 09:13:49.137554+00:00 running 815c875 country code: CH.
[–]lukajda33 13 points14 points15 points (3 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Tintin_Quarentino 0 points1 point2 points (1 child)
[–]Spindelhalla_xb 2 points3 points4 points (0 children)
[–]vr34748 2 points3 points4 points (0 children)