标签:mat 忽略 wds int alt 找不到 div 首字母 其他
test = "alex" v = test.capitalize() print(v)
test = "ALex" v1 = test.casefold() print(v1) v2 = test.lower() print(v2)
test = "alex" v = test.center(20, "*") print(v)
test = "alexalexr" v = test.count(‘ex‘,5,8) print(v)
test = "alex" v1 = test.endswith(‘x‘) v2 = test.startswith(‘b‘) print(v1) print(v2)
test = "alex\tdabai" v = test.expandtabs(16) print(v)
test = "alexalex" v1 = test.find("ex") v2 = test.find("ex", 5, 7) print(v1) print(v2)
test1 = "i am {name}" print(test1) v1 = test1.format(name = ‘alex‘) print(v1) test2 = "i am {0},age{1}" print(test2) v2 = test2.format(‘Iro man‘,35) print(v2)
test = "i am {name},age{a}" v = test.format_map({"name":"Iro man", "a":35}) print(v)
test = "alexalex" v1 = test.index("ex") print(v1) v2 = test.index(‘8‘) print(v2)
test1 = "asdfhisa123" test2 = "wdsf24_@$s2_^" v1 = test1.isalnum() v2 = test2.isalnum() print(v1) print(v2)
未完待续
标签:mat 忽略 wds int alt 找不到 div 首字母 其他
原文地址:https://www.cnblogs.com/dabai123/p/10926035.html