python 输入一个字符,是小写转换为大写,大写转换为小写,其他字符原样输出
时间:2018-11-03 22:44:44
收藏:0
阅读:225
s = input(‘请输入一个字符:‘) if ‘a‘ <= s <= ‘z‘: print(chr(ord(s) - 32)) elif ‘A‘ <= s <= ‘Z‘: print(chr(ord(s) + 32)) else:
print(‘s‘)
原文:https://www.cnblogs.com/chengxubo/p/9902311.html
评论(0)