I want to output difference two tuple and remove one element on tuple
a = [(1,2),(2,3),(3,3)]
if (1,2) in a:
       ## how to remove (1,2) on tuple 
i need output [(2,3),(3,3)] how to do it?
Thanks,
I want to output difference two tuple and remove one element on tuple
a = [(1,2),(2,3),(3,3)]
if (1,2) in a:
       ## how to remove (1,2) on tuple 
i need output [(2,3),(3,3)] how to do it?
Thanks,
 
    
    You can simply use .remove method for lists when you know the element that is to be removed.
>>> a = [(1,2),(2,3),(3,3)]
>>> a.remove((1,2))
>>> a
[(2, 3), (3, 3)]
 
    
    Other way, you can use del
>>> a = [(1,2),(2,3),(3,3)]
>>> del a[a.index((1,2))]
>>> a
[(2, 3), (3, 3)]
>>> 
or using .pop
>>> a = [(1,2),(2,3),(3,3)]
>>> a.pop(a.index((1,2)))
(1, 2)
>>> a
[(2, 3), (3, 3)]
>>> 
