Home  >  Article  >  Backend Development  >  Introduction to python basics - upper

Introduction to python basics - upper

Y2J
Y2JOriginal
2017-05-18 14:56:082540browse

Description

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

Syntax

upper() method syntax:

str.upper()

Parameters

NA.

Return value

Returns a string of lowercase letters converted to uppercase letters.

Examples

The following examples show how to use upper()function:

#!/usr/bin/python
str = "this is string example....wow!!!";
print "str.upper() : ", str.upper()

The output results of the above examples are as follows:

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

【Related recommendations】

1. Python free video tutorial

2. How to convert uppercase and lowercase in python

3. Detailed explanation of the use of lower and upper functions in python

The above is the detailed content of Introduction to python basics - upper. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn