remove an item in a set python code example Example 1: remove an item from a set python list.discard(item) Example 2: remove an element from a set list.remove(element)