Python 3 - String upper() Method


Description

The upper() method returns a copy of the string in which all case-based characters have been uppercased.

Syntax

Following is the syntax for upper() method −

str.upper()

Parameters

NA

Return Value

This method returns a copy of the string in which all case-based characters have been uppercased.

Example

The following example shows the usage of upper() method.

#!/usr/bin/python3

str = "this is string example....wow!!!"
print ("str.upper : ",str.upper())

Result

When we run above program, it produces the following result −

str.upper :  THIS IS STRING EXAMPLE....WOW!!!
python_strings.htm
Advertisements