如何将字符串转换为大写
发布于 2021-01-29 19:33:41
我在使用Python将字符串更改为大写时遇到问题。在我的研究中,我知道了,string.ascii_uppercase
但是没有用。
如下代码:
>>s = 'sdsd'
>>s.ascii_uppercase
给出此错误信息:
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'str' object has no attribute 'ascii_uppercase'
我的问题是: 如何在Python中将字符串转换为大写?
关注者
0
被浏览
106