def encrypt(msg,key):
result = ""
size = len(msg)
for i in range(0,size):
result = result + msg[(i - key) % size]
return result
msg = input("请输入明文:")
key = int(input("请输入密钥:"))
re =
print(re)
微信扫码预览、分享更方便