name = "my name is kim" print(name.capitalize()) # 首字母大写 print(name.count("m")) # 计数 print(name.center(50,"-")) # 居中,两端加横线 print(name.endswith("m")) # 判断以什么结尾,比如邮箱 print(name.find("name")) # 寻找从第几个字符起 print(name[name.find("name"):])
标签:class 字符 int with end 命令 highlight name python
name = "my name is kim" print(name.capitalize()) # 首字母大写 print(name.count("m")) # 计数 print(name.center(50,"-")) # 居中,两端加横线 print(name.endswith("m")) # 判断以什么结尾,比如邮箱 print(name.find("name")) # 寻找从第几个字符起 print(name[name.find("name"):])
标签:class 字符 int with end 命令 highlight name python
原文地址:https://www.cnblogs.com/rouge2017/p/8280661.html