可以在list中插入list吗
names1=['Alice','Bob','Candy','David','Ellena']
names2=['Gen','Phoebe','Zero']
names1.append(names2)
print(names1)
这样输出结果是:
['Alice','Bob','Candy','David','Ellena',['Gen','Phoebe','Zero']]
怎么样可以去掉输出结果中的[]?
names1=['Alice','Bob','Candy','David','Ellena']
names2=['Gen','Phoebe','Zero']
names1.append(names2)
print(names1)
这样输出结果是:
['Alice','Bob','Candy','David','Ellena',['Gen','Phoebe','Zero']]
怎么样可以去掉输出结果中的[]?
2020-09-24
举报