I want to remove a value from a list if it exists in the list (which it may not).
a = [1, 2, 3, 4] b = a.index(6) del a[b] print(a)
The abov
list1=[1,2,3,3,4,5,6,1,3,4,5] n=int(input('enter number')) while n in list1: list1.remove(n) print(list1)