What does upper mean in python?

爱喝马黛茶的安东尼
Release: 2019-07-25 09:50:35
Original
26003 people have browsed it

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()
Copy after login

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()
Copy after login

The output results of the above examples are as follows:

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template