Python isupper()方法

Python 教程 · 2019-02-02 13:56:57

描述

Python isupper() 方法检测字符串中所有的字母是否都为大写。

语法

isupper()方法语法:

str.isupper()

参数

  • 无。

返回值

如果字符串中包含至少一个区分大小写的字符,并且所有这些(区分大小写的)字符都是大写,则返回 True,否则返回 False

实例

以下实例展示了isupper()方法的实例:

#!/usr/bin/python

str = "THIS IS STRING EXAMPLE....WOW!!!"; 
print str.isupper();

str = "THIS is string example....wow!!!";
print str.isupper();

以上实例输出结果如下:

True
False

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

The Everything Store

The Everything Store

Brad Stone / Little, Brown and Company / 2013-10-22 / USD 28.00

The definitive story of Amazon.com, one of the most successful companies in the world, and of its driven, brilliant founder, Jeff Bezos. Amazon.com started off delivering books through the mail. Bu......一起来看看 《The Everything Store》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具