【Python小练习】单词首字母大小写判断

# 判断传单词首字母是否为大写
def ckWord(*args):
    for arg in args:
        if arg[0].isupper():
            print(True)
        else:
            print(False)
ckWord(input("请输入测试单词: "))
测试结果:
➜  pyPractice python3 test.py
请输入测试单词: Hello
True
➜  pyPractice python3 test.py
请输入测试单词: hELLO
False

猜你喜欢

转载自blog.csdn.net/weixin_54430466/article/details/122880803