无涯教程-Python - islower()函数

96 阅读1分钟

Python string methodislower()检查字符串的所有基于大小写的字符(字母)是否都是小写的。

islower() - 语法

str.islower()

islower() - 返回值

如果字符串中的所有大小写字符都是小写的,并且至少有一个大小写字符,则此方法返回true,否则返回false。

islower() - 示例

以下示例显示islower()方法的用法。

#!/usr/bin/python

str="THIS is string example....wow!!!"; print str.islower()

str="this is string example....wow!!!"; print str.islower()

当无涯教程运行上面的程序时,它产生以下输出-

False
True

参考链接

www.learnfk.com/python/stri…