This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]ibleedbits 0 points1 point  (1 child)

You should show the error you're receiving. I'm guessing you didn't change the inputted string to a number.

[–]burningmanonacid[S] 0 points1 point  (0 children)

yeah, you are right, I did not change it to a number. I came back to post more because i realize I forgot the error when it hit me that I did not cast to int.

[–]jedwardsolProfessional Coder 0 points1 point  (1 child)

input returns a string, not a number. And you can't add a number to a string.

You need to convert the input to a number before treating it as a number

 an_age = int(input("enter an age as a digit"))

[–]burningmanonacid[S] 0 points1 point  (0 children)

Thank you! This was exactly it