raise keyword in Python February 14, 2022 a = input('Enter your name: ')if a.isnumeric(): raise Exception('Numbers are not allowed')b = int(input('Enter any number: '))if b==0: raise ZeroDivisionError('0 is not allowed')print(f'Hello {b}') Share Get link Facebook X Pinterest Email Other Apps Share Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment