Answers for "delete by index python"

2

python list remove at index

a = ['a', 'b', 'c', 'd']
a.pop(1)

# now a is ['a', 'c', 'd']
Posted by: Guest on August-11-2020
1

how to remove an item from a certain index in python

arr = [0, 1, 2, 3, 4]
del arr[1]
# arr is now equal to [0, 2, 3, 4]
Posted by: Guest on January-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language