Source Code:
(back to article)
# Removing the first item from a list my_list = [1, 2, 3, 4, 5] del my_list[0] print(my_list) # [2, 3, 4, 5] # Removing a slice of items from a list my_list = [1, 2, 3, 4, 5, 6, 7, 8] del my_list[1:4] print(my_list) # [1, 5, 6, 7, 8]
Result:
Report an issue