Python String upper() Method


Advertisements


Description

The method upper() 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.

Live Demo
#!/usr/bin/python

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

When we run above program, it produces following result −

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

python_strings.htm

Advertisements