小册名称:Python合辑2-字符串常用方法
16、isupper()
判断字符串中的所有字母是否都为大写,是则返回True,否则返回False。
print('SIMPLE IS BETTER THAN COMPLEX'.isupper()) # Trueprint('SIMPLE IS BETTER THAN complex'.isupper()) # False
print('SIMPLE IS BETTER THAN COMPLEX'.isupper()) # True
print('SIMPLE IS BETTER THAN complex'.isupper()) # False