Python string methodislower()检查字符串的所有基于大小写的字符(字母)是否都是小写的。
str.islower()
如果字符串中的所有大小写字符都是小写的,并且至少有一个大小写字符,则此方法返回true,否则返回false。
以下示例显示islower()方法的用法。
#!/usr/bin/python str="THIS is string example....wow!!!"; print str.islower() str="this is string example....wow!!!"; print str.islower()
当无涯教程运行上面的程序时,它产生以下输出-
False True
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)