Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python upper() method

Python upper() method

Python Strings Python Strings


Description

The Python upper() method converts lowercase letters in a string to uppercase.

Syntax

Syntax of the upper() method:


str.upper()

Parameters

Return Value

Returns the string with lowercase letters converted to uppercase.

Example

The following example shows how to use the upper() function:


#!/usr/bin/python

str = "this is string example....wow!!!";

print "str.upper() : ", str.upper()

The output of the above example is:


str.upper() :  THIS IS STRING EXAMPLE....WOW!!!

Python Strings Python Strings