discard method in python

Solutions on MaxInterview for discard method in python by the best coders in the world

showing results for - "discard method in python"
Rupert
07 Jan 2017
1# the discard method removes the element from the set (a list or somthing else
2# as long as its mutable) only if it is found in it.
3list_a = [10, 30, 78, 10, 82, 66, 10]
4print(list_a.discard(10))
5# output: list_a = [30, 78, 82, 66]
similar questions
queries leading to this page
discard method in python