Python解决了麻烦

时间:2013-10-29 05:34:30

标签: python-2.7 function

我正在使用Python中的scrambler / unscrambler这个词。当我输入“scr”或“unscr”时,Python解释器会给我一个“ * Remote Interpreter Reinitialized * ”错误。当我删除“def menu():”它给我一个“TypeError:'dict'对象不可调用”。根据我选择的内容,参考scrambler()或unscrambler()。我似乎无法在代码中发现任何错误,当我将它与类似的代码进行比较时,它的实现没有任何明显的差异。任何帮助将非常感激!

scrambler = {}

unscrambler = {}

status = ""

def menu():

    status = raw_input("Do you want to scramble or unscramble text? scr/unscr")

    if status == "scr":
        scrambler()

    elif status == "unscr":
        unscrambler()

    else:
        print "Sorry, you didn't choose. Please Choose."
        menu()

def scrambler():
    .....

def unscrambler():
    .....

0 个答案:

没有答案