name_list = ['alex', '65brother', 'tenglan'] print(name_list) name_list.insert(2, '66brother') name_list.insert(2, '66brother') name_list.insert(2, '66brother') name_list.insert(2, '66brother') print(name_list) for i in range(name_list.count('66brother')): name_list.remove('66brother') print(name_list) li = list([1, 2, 3]) print(li.pop()) #返回值为删除的元素 print(li) print(li.append(4))
#无返回值 print(li) li.reverse() print(li) li.sort() print(li)