温馨提示×

python怎么将字母全部变为小写

小亿
159
2023-12-08 09:13:49
栏目: 编程语言
Python开发者专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

要将字母全部变为小写,可以使用字符串的`lower()`方法。下面是一个示例:

string = "Hello World"
lowercase_string = string.lower()
print(lowercase_string)

输出结果为:

hello world

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:python怎么将大写字母转化为小写

0