【发布时间】:2022-01-18 14:12:07
【问题描述】:
mappe = {10 : [10, 1]}
pair = list(mappe.values())
liste = []
liste.append((pair) + [5, 6])
--> [[10,1], 5, 6]]
如何去掉内括号?
【问题讨论】:
-
您的括号不平衡。此外,您想要的结果是什么?你只是想要一个列表
liste = [10, 1, 5, 6]?在这种情况下,只需写liste = pair + [5,6]。 -
liste = mappe[10] + [5, 6]或liste = list(mappe.values())[0] + [5, 6]