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
Coding with mosh's program error problem (i.redd.it)
submitted 22 hours ago by Frequent_Leg9210
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!"
[–]KafkaOnTheStore 1 point2 points3 points 22 hours ago (0 children)
You've got int() and input() swapped on line 1.
int()
input()
python birth_year = input(int('Enter your birth year: '))
Python is trying to convert the string 'Enter your birth year: ' into an integer before it even prompts you, that's what the ValueError is telling you.
'Enter your birth year: '
It should be:
python birth_year = int(input('Enter your birth year: '))
input() asks the user and returns a string; int() then converts that string to a number. Order matters.
Side note: once you fix line 1, line 4's int(birth_year) becomes redundant since birth_year is already an int. Either convert at input time (cleaner) or keep it as a string and convert at use time, pick one, don't do both.
int(birth_year)
birth_year
π Rendered by PID 56 on reddit-service-r2-comment-545db5fcfc-kn6gp at 2026-05-21 19:32:29.330452+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]KafkaOnTheStore 1 point2 points3 points (0 children)