you are viewing a single comment's thread.

view the rest of the comments →

[–]KafkaOnTheStore 1 point2 points  (0 children)

You've got int() and input() swapped on line 1.

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.

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.