Latest web development tutorials

Python lower()方法

Python 字符串 Python字符串


描述

Python lower() 方法轉換字符串中所有大寫字符為小寫。

語法

lower()方法語法:

str.lower()

參數

  • 無。

返回值

返回將字符串中所有大寫字符轉換為小寫後生成的字符串。

實例

以下實例展示了lower()的使用方法:

#!/usr/bin/python

str = "THIS IS STRING EXAMPLE....WOW!!!";

print str.lower();

以上實例輸出結果如下:

this is string example....wow!!!

Python 字符串 Python字符串