python列表listhtml
# 列表 list = ['a', 'b', 'c'] for str in list: print(str) # append()方法来添加列表项 list2 = [] list2.append("hello") list2.append(" python") print(list2) # del:根据索引来删除列表的元素 del list2[1] print(list2) # len(列表):长度 print(len(list)) # 组合 print(list + list2) # 重复 print(list * 2) # 元素是否存在于列表中 if 'a' in list: print('list列表中包含有\'a\'')
pop:删除最后一个python
remove(obj): 根据内容删除一个app
del list[索引]: 根据索引删除spa
python列表的方法:https://www.runoob.com/python/python-lists.htmlcode