Home  >  Article  >  Backend Development  >  What does upper mean in python?

What does upper mean in python?

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-06-20 18:04:0725982browse

What does upper mean in python?

What does upper mean in python? Here we will introduce you to upper().

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

upper() method syntax:

str.upper()

Parameters

NA.

Return value

Returns a string of lowercase letters converted to uppercase letters.

Related recommendations: "python video tutorial"

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 results of the above examples are as follows:

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

Summary

The opposite of upper() is the lower() method, which can convert strings into Convert uppercase letters to lowercase letters and use the same method.

The above is the detailed content of What does upper mean in python?. 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