list = [1,2,3,4,5,]
list.append(6) # [1, 2, 3, 4, 5, 6]
print(list)
list = [1,2,3,4,5,]
list.clear() # []
print(list)
list = [1,2,3,4,5,]
newlist = list.copy()
print(newlist) # [1, 2, 3, 4, 5]
list = [1,1,1,2,]
print(list.count(1)) # 3
list = [1,2,3,4,5,]
list.extend([6,7,8]) # [1, 2, 3, 4, 5, 6, 7, 8]
print(list)
list = [1,2,3,4,5,]
print(list.index(3)) # 2
list = [1,2,3,4,5,]
list.insert(2, 99)
print(list) # [1, 2, 99, 3, 4, 5]
list = [1,2,3,4,5,]
list.pop(2)
print(list)
list = [1,2,3,4,5,]
list.remove(2)
print(list) # [1, 3, 4, 5]
list = [1,2,3,4,5,]
list.reverse()
print(list) # [5, 4, 3, 2, 1]
list = [5,4,3,2,1,]
list.sort()
print(list) # [1, 2, 3, 4, 5]
Add new comment