Python3 string.tolower()方法

islower()方法检查字符串中所有可大小写的字符(字母)是否都为小写字母。

语法

以下是 istolower()方法的语法-
str.islower()

参数

  • NA

返回值

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

示例

下面的示例显示 islower()方法的使用。
#!/usr/bin/python3

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

str = "this is string example....wow!!!"
print (str.islower())
当我们运行上面的程序,会产生以下结果 -
False
True

上一篇: Python3数字 下一篇: Python3字符串