how to print error in try except python
try: # some code except Exception as e: print("ERROR : "+str(e))
how to print error in try except python
try: # some code except Exception as e: print("ERROR : "+str(e))
error handling Pyhtin
# taking input from the user try: age = int(input("Please enter your age: ")) print(age) except: print("please enter a number instead! ") print('bye') # if you wanna ask their age until they enter the correct number use While Loop while True: try: age = int(input("Please enter your age: ")) print(age) except: print("please enter a number instead! ") else: break
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us