Skip to content
Sign upLog in
← Back to Community

What does it mean for "10/age". I

Profile icon
LiWeiWei2

What does it mean for "10/age". I realized it cooperate with ZeroDivisionError.

while True:
try:

age=int(input('what is your age?')) 10/age print(age)

except ValueError:
print('Please enter a number')
except ZeroDivisionError:
print('Please enter age higher than 0')
else:
print('thank you!')
break
finally:
print('ok, I am finally done')

Voters
Profile icon
RameezNoor
Profile icon
LiWeiWei2
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

Besides, i think you figured it out, it works here.

Profile icon
SixBeeps

10/age doesn't do anything on its own. It divides the number 10 by whatever age you are, but it doesn't affect the age variable in any way. Are you trying to set age to 10/age?