python add remove from list code example
Example 1: how to delete list python
# delete by index
a = ['a', 'b', 'c', 'd']
a.pop(0)
print(a)
['b', 'c', 'd']
Example 2: removing an item from a list and adding it to another list python
item = 'b'
firstlist.remove(item)
secondlist.append(item)