浙大版《Python 程序设计》题目集 第3章-13 字符串替换 (15分)

s = list(input())
new = []
raw = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
rever_raw = list(reversed(raw))
dic = dict(zip(raw,rever_raw))
for each in s:
    if each in raw:
        each = dic.get(each)
    new.append(each)
new_s = ''.join(new)
print(new_s)
发布了33 篇原创文章 · 获赞 0 · 访问量 255

猜你喜欢

转载自blog.csdn.net/weixin_42229583/article/details/104589420
今日推荐