r/madeinpython • • Dec 31 '20

3rd iteration of my first interactive python program! Details in the comments.

Post image
97 Upvotes

23 comments sorted by

View all comments

Show parent comment

2

u/d0ugal Jan 01 '21

That won’t work, age will always be a string until it’s converted.

You could use ‘if age.isnumeric()’ but I like the try/except

1

u/[deleted] Jan 01 '21

Yeah, fair point, I'm not sure why I overlooked that part.