python中可以使用lower()方法将所有大写字符转换为小写字母。
lower()方法语法:
str.lower()
www#gaodaima.com来源gao($daima.com搞@代@#码(网搞代码
返回值
返回将字符串中所有大写字符转换为小写后生成的字符串。
示例:
#!/usr/bin/python <a href="https://www.gaodaima.com/tag/str" title="查看更多关于str的文章" target="_blank">str</a> = "THIS IS STRING EXAMPLE....WOW!!!"; print str.lower();
运行结果:
this is string example....wow!!!
更多Python知识请关注云海天Python教程栏目。
来源:搞代码网:原文地址:https://www.gaodaima.com