Quick actions

cmd+k|ctrl+k

Navigation

Languages

2026020401

Snippet info

Language

Python

Visibility

public

Author

shaoronghong15

Created

2026-02-04T13:44:30.357141Z

Updated

2026-02-04T13:48:09.469151Z

try:
    a = int(input('Please input a number (0-9):'))
    if a > 10:
        assert False, 'The number must be less than 9'
    print(a)
except AssertionError as msg:
    print(msg)
except TypeError:
    print('Program Error: It must be a number')
INFO