print("Enter the year you were born.")
birth-year = int(input())
age = 2017 - birth-year + 1
In the second line, the birthday-year is called can't sign to operator, but I don't know whyㅠㅠ
python syntax-error
If it is possible with a variable name, it is as follows.
Only underscore is possible; negative symbols cannot be used for variable names.
In other words, the code on the question, the birthday-year, becomes the code that subtracts the year variable from the birthday variable.
© 2024 OneMinuteCode. All rights reserved.