3 Antworten
+ 2
Append is for a single value, extend for iterables.
+ 8
Append: Adds its argument as a single element to the end of a list.
Extend(): Iterates over its argument and adding each element to the list and extending the list
+ 2
# You can see the difference in an example like this:
x = [0]
x.append([1, 2])
x.extend([3, 4])
print(x)