Error handling

This commit is contained in:
Hizenberg469
2025-03-20 21:02:12 +05:30
parent a0795f56ab
commit 3a195b2260
3 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Error Handling
while True:
try:
age = int(input('what is your age? '))
10/age
except ValueError:
print('please enter a number')
continue
except ZeroDivisionError:
print('please enter age higher than 0')
break
else:
print('thank you!')
break
finally:
print('ok, I\' finally done')
print('can you hear me?')