Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python String upper() method is used to convert all characters of the string in uppercase. Any symbol, space, special character or number in the string is ignored while applying this method. Only Alphabets are converted.

Syntax

string.upper()

Parameters

No parameter is required.

Return Value

Returns the string with all characters of the specified string in uppercase.

Example:

In the below example, upper() method is used to convert all characters of the string in uppercase.

MyString = "hello john!"
print(MyString.upper())

The output of the above code will be:

HELLO JOHN!

❮ Python String Methods