Python中extend和append的区别

2025-04-13 20:26:30
推荐回答(1个)
回答1:

>>>a = [1, 2]
>>>a.extend([3])
>>>a
[1, 2, 3]
>>>a.append([3])
>>>a
[1, 2, [3]]