I have two lists and I want to search for an item in one list and delete it in the other if it matches. But when I search one list, I don't know how to search the other, so I can only do one search at time. Do you guys know how can I do that?
list_groups = [['john', 'mary', 'peter'],
['luh', 'henry', 'maxi'],
['patrick', 'juva', 'xavier', 'dorovich']]
list_users = ['peter', 'henry', 'dorovich']
num = 0
num_group = 0
while num < 45:
user = list_users[num]
group = list_groups[num_group]
if user in group:
group.remove(user)
print(group)
else:
print(f'The user was not find in the group {num}')
num += 1
num_group += 1