How does upper() work in Python?

The upper() method in Python is used to return a string, with all the characters of the string calling the method in uppercase.

Syntax

string.upper()

Parameters

This method does not require any parameters.

Example

x = "The charachters in this string will become uppercase."
x = x.upper()
print(x)
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources