I have a function that takes a list of lists, as well as a regular list as arguments. Basically, all of these list items here start with a unique number. I want the first element of the second list to test against the first element of each individual list in the first list, and if they match, remove that list from listo1. I made a short example that doesn't work at all:
def deleteList(listo1, listo2):
if (listo2 in listo1):
listo1.remove(listo2)
print(listo1)
def main():
deleteList([[1000, 1],[2000, 2],[3000, 3]], [1000, 77])
So I'm trying to make listo2 search listo1 for anything that begins with the 1000 element. In this case, it should remove the first list [1000, 1] from listo1. How can I do this?