I have problem in changing a string into uppercase with Python.
(我在使用Python将字符串更改为大写时遇到问题。)
In my research, I gotstring.ascii_uppercase
but it doesn't work. (在我的研究中,我得到了string.ascii_uppercase
但它不起作用。)
The following code:
(以下代码:)
>>s = 'sdsd'
>>s.ascii_uppercase
Gives this error message:
(给出此错误消息:)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'str' object has no attribute 'ascii_uppercase'
My question is: how can I convert a string into uppercase in Python?
(我的问题是: 如何在Python中将字符串转换为大写?)
ask by gadss translate from so