可能重複:
Python: Once and for all. What does the Star operator mean in Python?在Python中* zip(list1,list2)返回什麼類型的對象?
x = [1, 2, 3]
y = [4, 5, 6]
zipped = zip(x, y)
list(zipped)
x2, y2 = zip(*zip(x, y))
x == list(x2) and y == list(y2)
什麼類型的對象呢*zip(x, y)
回報?爲什麼
res = *zip(x, y)
print(res)
不起作用?
第二個示例不起作用,因爲它不「返回對象」。 – 2012-03-17 22:58:58