Python3 swapcase()方法
Python 3 教程
· 2019-02-06 09:44:39
描述
swapcase() 方法用于对字符串的大小写字母进行转换。
语法
swapcase()方法语法:
str.swapcase();
参数
- NA。
返回值
返回大小写字母转换后生成的新字符串。
实例
以下实例展示了swapcase()函数的使用方法:
#!/usr/bin/python3 str = "this is string example....wow!!!" print (str.swapcase()) str = "This Is String Example....WOW!!!" print (str.swapcase())
以上实例输出结果如下:
THIS IS STRING EXAMPLE....WOW!!! tHIS iS sTRING eXAMPLE....wow!!!
点击查看所有 Python 3 教程 文章: https://www.codercto.com/courses/l/10.html
Zero to One
Peter Thiel、Blake Masters / Crown Business / 2014-9-16 / USD 27.00
“This book delivers completely new and refreshing ideas on how to create value in the world.” - Mark Zuckerberg, CEO of Facebook “Peter Thiel has built multiple breakthrough companies, and ......一起来看看 《Zero to One》 这本书的介绍吧!