运行环境python3
1234567891011121314151617181920def UCaseChar(ch): if ord(ch) in range(97, 122): return chr(ord(ch) - 32) else: return ch def LCaseChar(ch): if ord(ch) in range(65, 91): return chr(ord(ch) + 32) else: return ch def UCase(str): return ''.join(map(UCaseChar, str)) def LCase(str): return ''.join(map(LCaseChar, str)) print (LCase('ABC我abc')) print (UCase('ABC我abc'))
大小写转换
Your support will encourage me to continue to create!