gadss gadss - 3 months ago 10x
Python Question

How to change a string into uppercase

I have problem in changing a string into uppercase with Python. In my research, I got

but it doesn't work.

The following code:

>>s = 'sdsd'

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?

>>> s = 'sdsd'
>>> s.upper()

See String Methods.