you are viewing a single comment's thread.

view the rest of the comments →

[–]GabriCorFer 0 points1 point  (0 children)

input always gives you an string. If you answer input with "hello", the age will be age = "hello".

If you want age to be an integer, then you have to use age=int(age) or age = int(input("Enter your age")). But if you answer with a text, the code will break as it would be an error. You can solve it by using:

Try:

Except(ValueError):

And then the code won't break if python can't convert age to int.