py。002 字符串(str)

istitle 判断首字母是否为大写 islower 判断首字母是否为小写s. lower() 转换小写字母
s.capitalize 首字母大写。 s.upper() 全部大写
count 计数器 index 索引
if elif (减少判断次数) else 要么这样,要么那样
find 找到对应的index值 找不到就返回-1
index 找不到就报错。
strip()去除前后空格
eval() 把表达式转化为算式
replace ()替换(旧,新 ,替换次数)
random.randint(a,b)
center 居中 (宽度,‘字符串’)
| \\ | 反斜杠符号 |
| \' | 单引号 |
| \" | 双引号 |
| | 换行 |
| | 横向制表符 |
| | 回车 |
原文地址:https://www.cnblogs.com/kaiyaoweixiao/p/13275586.html