Python字符判断(不用ASC||码)

img

n = input(">>>")

if len(n) != 1:
    print("ERROR")
else:    
    if "Z" >= n >= 'A':
        print("大写字母")
    elif "z" >= n >= 'a':
        print("小写字母")
    elif '9' >= n >= '0':
        print("数字")
    else:
        print("其他字符")