Python istitle()方法

栏目: 编程语言 · Python · 编程教程 · python 教程 · 发布时间: 7年前

内容简介:Python istitle() 方法检测字符串中所有的单词拼写首字母是否为大写,且其他字母为小写。

描述

Python istitle() 方法检测字符串中所有的单词拼写首字母是否为大写,且其他字母为小写。

语法

istitle()方法语法:

str.istitle()

参数

  • 无。

返回值

如果字符串中所有的单词拼写首字母是否为大写,且其他字母为小写则返回 True,否则返回 False.

实例

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

#!/usr/bin/python


str = "This Is String Example...Wow!!!";
print str.istitle();

str = "This is string example....wow!!!";
print str.istitle();

以上实例输出结果如下:

True
False

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Out of their Minds

Out of their Minds

Dennis Shasha、Cathy Lazere / Springer / 1998-07-02 / USD 16.00

This best-selling book is now available in an inexpensive softcover format. Imagine living during the Renaissance and being able to interview that eras greatest scientists about their inspirations, di......一起来看看 《Out of their Minds》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具