Python中处理字符串之islower()方法的使用简介

yipeiwu_com6年前Python基础

 islower()方法判断检查字符串的所有的字符(字母)是否为小写。
语法

以下是islower()方法的语法:

str.islower()

参数

  •     NA

返回值

如果字符串中的所有字符是小写且有至少有一个字符此方法返回true,否则返回false。
例子

下面的例子显示 islower()方法的使用。

#!/usr/bin/python

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

str = "this is string example....wow!!!";
print str.islower();

当我们运行上面的程序,它会产生以下结果:

False
True


相关文章

Flask中endpoint的理解(小结)

在flask框架中,我们经常会遇到endpoint这个东西,最开始也没法理解这个到底是做什么的。最近正好在研究Flask的源码,也就顺带了解了一下这个endpoint 首先,我们看一个...

浅谈Pandas:Series和DataFrame间的算术元素

如下所示: import numpy as np import pandas as pd from pandas import Series,DataFrame 一、Series与...

微信跳一跳自动运行python脚本

本文实例为大家分享了微信小程序跳一跳自动运行脚本,供大家参考,具体内容如下 1、压缩包带了adb等必须工具,配置一下环境变量即可 2、Python 直接运行即可 (Python3.6)...

Jupyter notebook在mac:linux上的配置和远程访问的方法

upyter Notebook已经逐渐取代IDE成为了多平台上写简单Python脚本或应用的几家选择。 Jupyter Notebook可以通过pip/pip3安装: pip3 inst...

python3.8下载及安装步骤详解

python3.8下载及安装步骤详解

1.操作系统:Windows7 64bit Python版本:3.8下载地址:https://www.python.org/downloads/release/python-380/,选...