Python 12, exception

 #exception failed

a, b = 10, 'fifteen'
print(a+b)







#exception success
a, b = 10, 'fifteen'

try :
    print(a+b)
except Exception as e:
    print(f'Something went wrong {e}') # e disini akan muncul pesan ksalahan dr system
except TypeError as e:
    print('Please enter a number in the form of an integer or a float')

print('Continuing with the program...')









0 Response to "Python 12, exception"

Posting Komentar