Python3 lower()方法

Python3 字符串 Python3 字符串


描述

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

語法

lower()方法語法:

str.lower()

參數(shù)

  • 無。

返回值

返回將字符串中所有大寫字符轉(zhuǎn)換為小寫后生成的字符串。

實例

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

#!/usr/bin/python3

str = "W3CSchool EXAMPLE....WOW!!!"

print( str.lower() )

以上實例輸出結(jié)果如下:

youj example....wow!!!

Python3 字符串 Python3 字符串