Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.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_List_Pointers_Split - Fatal编程技术网

Python中有类似指针的东西吗

Python中有类似指针的东西吗,python,list,pointers,split,Python,List,Pointers,Split,我想了解Python中的以下代码片段: name, *line=input().split() scores=list(map(float, line)) 我理解input(),split(),map函数。我希望有人能解释一下赋值name、*line在这里是如何工作的,以及变量line在后面的表达式中是如何使用的。这个*与指针无关。@user2357112:那么你能详细说明一下它的概念吗。str.split可以产生多个值name,*line=input().split()将第一个值解压为nam

我想了解Python中的以下代码片段:

name, *line=input().split()
scores=list(map(float, line))

我理解
input()
split()
map
函数。我希望有人能解释一下赋值
name、*line
在这里是如何工作的,以及变量
line
在后面的表达式中是如何使用的。

这个
*
与指针无关。@user2357112:那么你能详细说明一下它的概念吗。
str.split
可以产生多个值
name,*line=input().split()
将第一个值解压为
name
,将其余值解压为
line
@PeterWood,那么
line
是数组还是自动重新加入?