python remove list item if exists code example Example: python list remove at index a = ['a', 'b', 'c', 'd'] a.pop(1) # now a is ['a', 'c', 'd']