Home / Python / Reference / String methods

Python string upper() method

Return the string in upper case.

Syntax

str.upper()

Strings cannot change, so this returns a new string; keep it with s = s.upper(…).

Parameters

None.

Return value

str

Example

Code

print("brisbane".upper())
code = "ab12"
print(code.upper())

Output

BRISBANE
AB12

Related

Learn it step by step in the free lesson Strings, with exercises that check your answers.