>>> 'aabbc'.startswith('a') #判断字符串是否以某个字符开头,可以是多字符
True
>>> 'aabbc'.startswith('b')
False
>>> 'aabbc'.startswith('aab')
True
>>> 'aaBBcc'.swapcase() #转换大小写
'AAbbCC'
>>> 'wend is ok'.title() #标题格式,首字母大写,其它字符小写
'Wend Is Ok'
>>> 'wend is ok'.upper() #将字符全部转换成大写
'WEND IS OK'
>>> 'wend is ok'.zfill(20) #这里的z指zero,用0将字符填充到指定长度
'0000000000wend is ok'