30、swapcase()
翻转字符串中的字母大小写。
s = 'HELLO world'
s = s.swapcase()
print(s)
# hello WORLD
31、zfill()
string.zfill(width)
返回长度为width的字符串,原字符串string右对齐,前面填充0。
s = '42'.zfill(5)
print(s)
# 00042
s = '-42'.zfill(5)
print(s)
# -0042
s = '+42'.zfill(5)
print(s)
# +0042