Try_except

PHOTO EMBED

Tue Mar 01 2022 22:59:43 GMT+0000 (Coordinated Universal Time)

Saved by @Milados

def try_except_fun():
    while True:
        try:
            res = int(input('Input a number:'))
        except:
            print('Not an integer')
            continue
        else:
            print('if exception doesnt happen')
            break
content_copyCOPY

http://localhost:8888/notebooks/Untitled.ipynb?kernel_name