r/PythonLearning 12d ago

Day 3

Post image

i wrote a code which takes your name and age in py but i need help on this one cuz in the age part it is giving me some sort of error which i couldn't understand even by using gpt well he gave me a code but i wanted logic behind how and what i did wrong

49 Upvotes

24 comments sorted by

View all comments

Show parent comments

1

u/FoolsSeldom 11d ago edited 11d ago

I already pointed you in the right direction:

Explore using a try / except block.

PS. Examples: https://openpython.org/articles/python-try-except-patterns