在第3行输入名称时出错

时间:2017-02-24 04:19:06

标签: arrays dictionary addressbook

def newname():
    info= {}
    info["fname"] = input("What is this contacts first name: ")
    info["lname"] = input("What is this contacts last name: ")
    info["address"] = input("What is this contacts address: ")
    info["city"] = input("What is this contacts city: ")
    info["state"] = input("What is this contacts state: ")
    info["zip"] = input("What is this contacts zip: ")
    info["number"] = input("What is this contacts number: ")
    addressbook.append(info)

我正在尝试创建一个地址簿,并且为了添加新人,在运行我的字典时,我收到此错误消息文件“第3行,在newname中     info [“fname”] =输入(“这是什么联系人姓名:”)   NameError中的文件“”,第1行:名称'Rob'未定义。只是想知道我在这里失踪了什么。谢谢你的帮助。

0 个答案:

没有答案