恺撒密码 B

 1 ss = input()
 2 t = ""
 3 for i in ss:
 4     if 'a' <= i <= 'z':
 5         t += chr( ord('a') + ((ord(c)-ord('a')) + 3 )%26 )
 6     elif 'A'<=c<='Z':
 7         t += chr( ord('A') + ((ord(c)-ord('A')) + 3 )%26 )
 8     else:
 9         t += i
10 print(t)

 

posted @ 2020-03-22 13:29  zzh007  阅读(207)  评论(0编辑  收藏  举报