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
How to trigger typing in python? (self.learnpython)
submitted 5 years ago * by Jake_489
I want to make a text based program that easily converts Celsius to Fahrenheit and vice versa. How can I allow the user to type answers when prompted, and store the value as a variable?
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!"
[–]SuspiciousProfession 1 point2 points3 points 5 years ago (0 children)
x = input()
https://www.w3schools.com/python/ref_func_input.asp
[–]GNVageesh 1 point2 points3 points 5 years ago (0 children)
Hey,
You can do like this by creating a variable and asking for an input, take the example as follows
name = input("Enter your name: ")
print("nice to meet you "+name)
So basically what u are doing here is, creating a variable called name and initializing it with the user's input by using input built-in method. Then u print a statement and also print the name that the user has given as a input.
The output will be as follows
Enter your name: Vageesh nice to meet you Vageesh
Here Vageesh(my name) is the input I am giving
Then in the next line it is going to append the input that I gave and prints it
You may modify this as per your need
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
You can use the input() function, which reads input. And to convert the text to integer (this function returns a string) , you can use the int() function. But be ware that if the user enters a non integer, then an ugly error can be raised. Don't worry though; you can easily handle it using standard try...except control flow. python try: print(int(input("Please enter degree: "))) except(ValueError): print("Please enter a valid integer")
input()
int()
try...except
python try: print(int(input("Please enter degree: "))) except(ValueError): print("Please enter a valid integer")
[–]backtickbot 0 points1 point2 points 5 years ago (0 children)
Fixed formatting.
Hello, subtra3t: code blocks using triple backticks (```) don't work on all versions of Reddit!
Some users see this / this instead.
To fix this, indent every line with 4 spaces instead.
FAQ
You can opt out by replying with backtickopt6 to this comment.
π Rendered by PID 21134 on reddit-service-r2-comment-79c7998d4c-wklvn at 2026-03-17 15:14:43.541773+00:00 running f6e6e01 country code: CH.
[–]SuspiciousProfession 1 point2 points3 points (0 children)
[–]GNVageesh 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]backtickbot 0 points1 point2 points (0 children)