2014-11-02 137 views
0
elif choice == "2": 
    print("These are terms stored in the dictionary so far: ") 
    for i in values_so_far: 
     print(i) 
    term = input("\nWhat term do you want me to add?: ") 
    if term not in Dictionary: 
     definition = input("\nWhat's the definition?: ") 
     Dictionary[term] = definition 
     print("\n",term,"has been added") 
     Dictionary.append[term] 
     values_so_far.append[term] 
    else: 
     print("\nThat term already exists! Try redefining it [option: 3]") 

產生錯誤信息:
回溯(最近通話最後一個):
文件 「C:\用戶\弗林\桌面\程序\程序Dictionary.py」,第98行,在
Dictionary.append [術語] AttributeError的:「字典」對象沒有屬性「追加」爲什麼我無法將新術語添加到字典中?

回答

相關問題