Python String upper() MethodPython Functions


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

Example

#!/usr/bin/python3
# -*- coding: UTF-8 -*-

str = "have a nice day....wow!!!"
print ("str.upper(): ", str.upper())

Output:

str.upper():  HAVE A NICE DAY....WOW!!!

Syntax

str.upper()

Parameters

The method doesn’t take any parameters.

Return Value

It returns the uppercased string from the given string.

© 2021 Programtips.org, all rights reserved. Privacy Policy | Contact Us