假设我有这些任务:
points = []
point = (1, 2)
我怎么会这样做:
points += point
它工作得很好,并给了我点 = [1, 2]。但是,如果我这样做:
points = points + point
它给了我一个 TypeError: can only concatenate list (not "tuple") to list。但是,这些陈述不是一回事吗?
假设我有这些任务:
points = []
point = (1, 2)
我怎么会这样做:
points += point
它工作得很好,并给了我点 = [1, 2]。但是,如果我这样做:
points = points + point
它给了我一个 TypeError: can only concatenate list (not "tuple") to list。但是,这些陈述不是一回事吗?