Python-字符串内容检测
str.isnumeric():
检测字符串是否只由数字组成
str.isalpha():
检测字符串是否只由字母组成
str.islower():
检测字符串中所有的字母是否都为小写
str.isupper():
检测字符串中所有的字母是否都为大写
更多isxxx()方法请参考:
https://docs.python.org/3/library/stdtypes.html#string-methods
str.isnumeric():
检测字符串是否只由数字组成
str.isalpha():
检测字符串是否只由字母组成
str.islower():
检测字符串中所有的字母是否都为小写
str.isupper():
检测字符串中所有的字母是否都为大写
更多isxxx()方法请参考:
https://docs.python.org/3/library/stdtypes.html#string-methods