python中提供了丰富的字符串处理函数,很多都可以以不同方式处理大小写的转换
常用的有这些
# 我多敲了好多回车...只是为了看得清楚一点
>>> notMe = 'lapland Stark is an elf'
>>> print("source string is ", notMe)
source string is lapland Stark is an elf
>>>
>>> print("swapcase demo", notMe.swapcase(), sep='\t')
swapcase demo LAPLAND sTARK IS AN ELF
>>>
>>> print("upper demo", notMe.upper(), sep='\t')
upper demo LAPLAND STARK IS AN ELF
>>>
>>> print("lower demo", notMe