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

查看所有标签

Modeling the Internet and the Web

Modeling the Internet and the Web

Pierre Baldi、Paolo Frasconi、Padhraic Smyth / Wiley / 2003-7-7 / USD 115.00

Modeling the Internet and the Web covers the most important aspects of modeling the Web using a modern mathematical and probabilistic treatment. It focuses on the information and application layers, a......一起来看看 《Modeling the Internet and the Web》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具