我已经制作了一种秘密语言,我可以将完整的单词放入输入中并获得输出,因为列表中的字母应该是这样。假设例如我输入“AB”,我希望输出为“QW”。
while True:
print("type sentence you want translated")
Befor=input()
After=list(Befor)
if Befor=="A":
print("Q")
elif Befor=="B":
print("W")
elif Befor=="C":
print("E")
elif Befor=="D":
print("R")
else:
print("--")
print(After)
pass
Run Code Online (Sandbox Code Playgroud)