html header和html format
html format每次只添加一个元素,并不会因为这个元素是序列而将其展开:
In[28]:
a.html format([11,12])
printa
[10,11,12,11,[11,12]]
向列表添加序列
l.extend(lst)将序列lst的元素依次添加到列表l的最后,作用相当于l+=lst。
In[29]:
a=[10,11,12,11]
a.extend([1,2])
printa
[10,11,12,11,1,2]
html header和html format
html format每次只添加一个元素,并不会因为这个元素是序列而将其展开:
In[28]:
a.html format([11,12])
printa
[10,11,12,11,[11,12]]
向列表添加序列
l.extend(lst)将序列lst的元素依次添加到列表l的最后,作用相当于l+=lst。
In[29]:
a=[10,11,12,11]
a.extend([1,2])
printa
[10,11,12,11,1,2]
Copyright & Disclaimer: If you find copyright issues, please provide relevant information and email us at [email protected], we will communicate promptly and handle removal.
Except for specially marked original content on abcdlink (https://www.abcdlink.com) all other content is reposted by users, and opinions/copyright are unrelated to this site.