isupper

isupper() and islower() both are the in- built methods in Python which works with the strings.

isupper()和islower()都是Python中的内置方法,可与字符串一起使用。

1)字符串isupper()方法 (1) String isupper() Method)

isupper() returns "true" if all characters of the string are uppercase character.

如果字符串的所有字符均为大写字符,则isupper()返回“ true”。

Syntax:

句法:

 String.isupper()

Parameter: None

参数:

Return type:

返回类型:

  • true - if all characters of the string are uppercase characters.

    true-如果字符串的所有字符均为大写字符。

  • false - if any of the characters is not in uppercase character.

    false-如果任何字符都不大写。

Example:

例:

# str1 with all uppercase characters
str1 = "GOOGLE"
print str1.isupper()
# str2 with uppercase character, DOT, SPACE
str2 = "GOOGLE.COM"
print str2.isupper()
# str3 with uppercase and lowercase characters
str3 ="GOOGLE.com"
print str3.isupper()
# str4 with all lowercase characters
str4 = "google.com"
print str4.isupper()

Output

输出量

    True
True
False
False
.minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } } .minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } }

2)字符串islower()方法 (2) String islower() Method)

islower() returns "true" if all characters of the string are lowercase character.

如果字符串的所有字符均为小写字符,则islower()返回“ true”。

Syntax:

句法:

 String.islower()

Parameter: None

参数:

Return type:

返回类型:

  • true - if all characters of the string are lowercase characters.

    true-如果字符串的所有字符均为小写字符。

  • false - if any of the characters is not in lowercase character.

    false-如果任何字符都不是小写字符。

Example:

例:

# str1 with all lowercase characters
str1 = "google"
print str1.islower()
# str2 with lowercase character, DOT, SPACE
str2 = "google.com"
print str2.islower()
# str3 with lowercase and uppercase characters
str3 ="google.COM"
print str3.islower()
# str4 with all uppercase characters
str4 = "GOOGLE.COM"
print str4.islower()

Output

输出量

    True
True
False
False

翻译自: https://www.includehelp.com/python/string-isupper-and-islower-methods-with-examples.aspx

isupper

isupper_Python字符串| isupper()和islower()方法以及示例相关推荐

  1. isupper_Python字符串isupper()

    isupper Python String isupper() function returns True if all the cased characters are in Uppercase. ...

  2. Python字符串| join()方法与示例

    join() is an in-built method in Python and it is used to join elements of the list, string etc with ...

  3. Python字符串| isdigit()方法与示例

    isdigit() is an in-built method in Python, which is used to check whether a string contains only dig ...

  4. Python字符串| isdecimal()方法与示例

    isdecimal() is an in-built method in Python, which is used to check whether a string contains only d ...

  5. isnumeric_Python字符串| isnumeric()方法与示例

    isnumeric isnumeric() is an in-built method in Python, which is used to check whether a string conta ...

  6. isalpha函数 python怎么用_Python字符串| isalnum()和isalpha()方法以及示例

    1)isalpha()方法 isalpha()如果字符串的所有字符都是字母(" A"至" Z"之间以及" a"至" z" ...

  7. 字符串startswith_JavaScript字符串startsWith()方法与示例

    字符串startswith 字符串startsWith()方法 (String startsWith() Method) startsWith() method is a string method ...

  8. charcodeat_JavaScript字符串charCodeAt()方法及示例

    charcodeat 字符串charCodeAt()方法 (String charCodeAt() Method) charCodeAt() Method is a string method in ...

  9. Python字符串join()方法

    Python string join() method creates a string from an iterable. It joins all the iterable elements wi ...

  10. python字符串startswith_Python 字符串 startswith() 使用方法及示例

    Python 字符串 startswith() 使用方法及示例 如果字符串以指定的前缀(字符串)开头,则startswith()方法将返回True.如果不是,则返回False. startswith( ...

最新文章

  1. 自定义堆栈(回文检测)
  2. C#调用C++dll
  3. 白话Elasticsearch73_ES生产集群中的索引管理02
  4. 成功解决Building wheels for collected packages: dlib Running setup.py bdist_wheel for dlib ... error
  5. 不使用jQuery对Web API接口POST,PUT,DELETE数据
  6. 在windows上搭建Apache+Trac+Subversion
  7. 20 个势头最猛的开发者工具
  8. BUUCTF--- LFI-------本地文件包含(Local File Include)
  9. 软件测试学习指南(更新中)
  10. HTTP 返回304
  11. 除了待办清单,用 Things 还能做什么?
  12. Dubbo视频教程(Dubbo项目实战)
  13. 萤火虫算法求解简单TSP问题
  14. Java同步锁synchronized的最全总结
  15. minitab学习系列(2)--CPK、PPK案例解析
  16. web开发html如何把图片居中,css中怎么让img图片居中
  17. Gap Statistic算法详解
  18. pl/sql 执行sql文件以及批量执行sql文件
  19. css动态特效 @keyframes
  20. Linux简介-远程操作-文本编辑器-1

热门文章

  1. 银行储蓄系统软件结构图
  2. Dart语言入门(一)
  3. [MATLAB]--曲线拟合(polyfit/polyval)
  4. 【变压器版图设计】利用ADS生成变压器版图
  5. 八、Servlet容器
  6. 静态库和动态库运行时间的区别
  7. pdf怎么移除权限口令,忘记pdf密码如何找回?
  8. 微信小程序弹窗底部不滚动-穿透
  9. 主数据管理功能模块、实施、提供厂商
  10. 信息系统集成监理费收取标准_信息系统工程监理与咨询服务收费参考标准起草说明...