Latest web development tutorials

Python islower()方法

Python 字符串 Python字符串


描述

Python islower() 方法檢測字符串是否由小寫字母組成。

語法

islower()方法語法:

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

Python 字符串 Python字符串