小编Sim*_*nes的帖子

从列表中取出字符并将其转换为其他字符

我已经制作了一种秘密语言,我可以将完整的单词放入输入中并获得输出,因为列表中的字母应该是这样。假设例如我输入“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)

python string python-3.x

6
推荐指数
1
解决办法
454
查看次数

标签 统计

python ×1

python-3.x ×1

string ×1