官方文档:https://docs.python.org/zh-cn/3/library/stdtypes.html#string-methods
- str.lower() :转换为小写
- str.islower() : 字符串里所有的字母是否为小写
- len(str) : 返回字符串的长度
- str1.count(str2) : str1中含有str2的数量
更多方法请参考官方文档
str = "Hello world"
print(str.islower())
print(str.lower())
print(str.count("o"))
print(str.find("w"))
#打印结果
#False
#hello world
#2
#6