<pre name="code" class="python">L = ['hello', 'world', 100]
L2 = ['xxx', 'yyy']
L3 = [999, 888]
L.append(L3)
print L
L2.extend(L3)
print L2
python List append() vs. extend()
最新推荐文章于 2023-12-19 15:48:56 发布
<pre name="code" class="python">L = ['hello', 'world', 100]
L2 = ['xxx', 'yyy']
L3 = [999, 888]
L.append(L3)
print L
L2.extend(L3)
print L2