@lukeSep 08.2022 — #As the input is a string you would need to cast the input string to an int.
You can do this directly when the input has been submitted with:
age = int(input("Insert your age: "))
However I would recommend validating the input before doing this to prevent throwing an exception with a null/empty check + an 'is numeric' check using:
age.isnumeric() which returns a boolean
age = input("Insert your age: ") if (age == None or age == '') return if (!age.isnumeric()) return ageInt = int(age)
@delta1512Aug 17.2022 — #The 'input' built-in will always return a string from the user input. Create a new integer by wrapping it with the int built-in:
age = int(input("Insert your age: "))
However, you may want to do input sanitisation, otherwise you will get a ValueError if the user doesn't input a number. This can be handled like so (although you may want to use something like regex in the long-run): try: age = int(input("Insert your age: ")) except ValueError: print('Incorrect age, please try again!') ...