Python判断用户输入的字符是否为字母
示例说明:
Python判断用户输入的字符是否为字母
判断字母与否的为字母的代码:
c = input("请输入字符:") if (c >= 'a' and c <= 'z') or (c >= 'A' and c <= 'Z'): print(format(c), '是一字母') else: print(format(c), '不是一字母')
Python判断用户输入的字符是否为字母
c = input("请输入字符:") if (c >= 'a' and c <= 'z') or (c >= 'A' and c <= 'Z'): print(format(c), '是一字母') else: print(format(c), '不是一字母')