codecamp

Python lower()方法

Python lower()方法


描述

Python lower() 方法转换字符串中所有大写字符为小写。

语法

lower()方法语法:

str.lower()

参数

  • 无。

返回值

返回将字符串中所有大写字符转换为小写后生成的字符串。

实例

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

#!/usr/bin/python

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

print str.lower();

以上实例输出结果如下:

this is string example....wow!!!
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }