-2

For example I have a list that looks like this:

l = [(1,2),(1,3),(4,1)]

how can I remove item (1,3) without knowing the index of the item?

I tried l.pop((1,3)) but I got this error message: TypeError: an integer is required

halfer
  • 19,824
  • 17
  • 99
  • 186
sam jack
  • 25
  • 7

1 Answers1

0
l = [(1,2),(1,3),(4,1)]
print(l) #[(1, 2), (1, 3), (4, 1)]
l.remove((1,3))
print(l) #[(1, 2), (4, 1)]
xyz
  • 306
  • 3
  • 11