Python 字符串大小写转换
Python 3 教程
· 2019-02-12 15:12:13
以下代码演示了如何将字符串转换为大写字母,或者将字符串转为小写字母等:
# Filename : test.py # author by : www.codercto.com str = "www.codercto.com" print(str.upper()) # 把所有字符中的小写字母转换成大写字母 print(str.lower()) # 把所有字符中的大写字母转换成小写字母 print(str.capitalize()) # 把第一个字母转化为大写字母,其余小写 print(str.title()) # 把每个单词的第一个字母转化为大写,其余小写
执行以上代码输出结果为:
WWW.CODERCTO.COM www.codercto.com Www.codercto.com Www.Codercto.Com
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
A Philosophy of Software Design
John Ousterhout / Yaknyam Press / 2018-4-6 / GBP 14.21
This book addresses the topic of software design: how to decompose complex software systems into modules (such as classes and methods) that can be implemented relatively independently. The book first ......一起来看看 《A Philosophy of Software Design》 这本书的介绍吧!
图片转BASE64编码
在线图片转Base64编码工具
HEX HSV 转换工具
HEX HSV 互换工具