保存用户输入 - Python3.2

时间:2014-12-31 15:29:10

标签: python save user-input

我是python的新手,

我正在尝试制作一个程序,其中用户键入符号然后输入一个字母,然后当他们按下输入时,它将被替换。我已经设法让它替换一个字母的符号,但是一旦用户再次执行它,他们替换的前一个字母不会保存,它只会返回到它的符号。我自己试着寻找答案,但无论我尝试什么都会出现错误,或者似乎没有效果。我希望有人可以帮助我。

以下是我的代码部分:

s = 0
while s < 1000:
    clues_list=[]
    question1= input("What symbol:")
    question2= input("Which letter:")

    for symbol in words_list:
        newcontentsA = (word)
        newcontentsA = newcontentsA.replace('#','A') # the clues to help the user
        newcontentsA = newcontentsA.replace('*','M') # the clues to help the user
        newcontentsA = newcontentsA.replace('%','N') # the clues to help the user
        newcontentsA=newcontentsA.replace(question1,question2)
        print(newcontentsA)
        clues_list.append(newcontentsA)

0 个答案:

没有答案