Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 名称错误:名称';用户记录';没有定义_Python - Fatal编程技术网

Python 名称错误:名称';用户记录';没有定义

Python 名称错误:名称';用户记录';没有定义,python,Python,我在Python3.7中运行这段代码 record = ('Dave', 'dave@example.com', '773-555-1212', '847-555-1212') name, email, *phone_numbers = user_record 错误: Traceback (most recent call last): File "C:\UsersPythonWizard\Desktop\Python\Python.py", line 2, in <module&g

我在Python3.7中运行这段代码

record = ('Dave', 'dave@example.com', '773-555-1212', '847-555-1212')
name, email, *phone_numbers = user_record
错误:

Traceback (most recent call last):
  File "C:\UsersPythonWizard\Desktop\Python\Python.py", line 2, in <module>
    name, email, *phone_numbers = user_record
NameError: name 'user_record' is not defined
>>> 
回溯(最近一次呼叫最后一次):
文件“C:\UsersPythonWizard\Desktop\Python\Python.py”,第2行,在
姓名、电子邮件、*电话号码=用户记录
NameError:未定义名称“用户\记录”
>>> 

您将元组定义为
record
,而不是
user\u record
,因此未定义
user\u record
。把一个变量换成另一个变量,你就会变好