How to Remove List Item of Specified Index in Python


In this example, we will learn how to remove the list item of the specified index using the del keyword in Python.

Source Code

my_list = ['a', 'b', 'c', 'd', 'e']
del my_list[2]
print(my_list)

Output:

['a', 'b', 'd', 'e']

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement