I've been trying to make my simple code work and searching different methods of checking to see if a variable is a certain type when using if statements
# Are you tall enough to ride the roller coaster
print('This will determine if you are able to ride this Rollar Coaster?')
age = int(input('How old are you? '))
if isinstance(age, int):
print('Please input a valid age')
elif age <= 12:
print('You are not old enough to ride this ride!')
else:
height = int(input('How tall are you? Enter in centimeters please: '))
if height > 72:
print('You may enter, enjoy the ride')
else:
print('You are not tall enough to ride.')
I've searched and googled stack overflow and i came across the isinstance and issubclass and they dont seem to work. I also tried while != int
although I'm not entirely sure that code works.