Python - String upper() Method


Advertisements

The 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.

Example:

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

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

Output

HELLO JOHN!

String Methods
Advertisements