字符串反码 A

时间:2021-09-16 00:31:19   收藏:0   阅读:54

s = input()
for c in s:
if ‘a‘ <= c <= ‘z‘:
print(chr(ord(‘z‘)-(ord(c)-ord(‘a‘))),end=‘‘)
elif ‘A‘ <= c <= ‘Z‘:
print(chr(ord(‘Z‘)-(ord(c)-ord(‘A‘))),end=‘‘)
else:
print(c,end=‘‘)

原文:https://www.cnblogs.com/shizihao/p/15267454.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!