while True:
a=input ('Enter your age:')
if type(a)==str:
print ('Please enter an age number')
else:
print('OK')
break
I'm a beginner at Python. I've done this much, but I can't do it anymore. Haha.
If you receive your age as a non-integer string, you must create a program that repeats until you enter your age.
Thank you
python
if type(a)==str:
Instead, write it like this
if type(a)=='<class \'str\'>':
© 2024 OneMinuteCode. All rights reserved.