try:
number = int('hello')
print('Valid')
except ValueError:
print('Invalid')
hello Valid Invalid ValueError valid = False
try:
number = int('ten')
valid = True
except ValueError:
valid = False
print(valid)
True 0 ten False You can still revise this topic