0
Let’s say I have the following list:
lista_de_dados = [['nome', 'prioridade', 'hora', 'consultório', 'Número na fila'],
['Gabriel', 'Comum', '16:30', 'Dermatologia', 1]
['Gabrielle', 'Preferencial', '16:31', 'Dermatologia', 2]]
And I want to create a function to delete one of these lists inside the data list without deleting the others. For example, suppose I want to delete the list that contains Gabrielle’s information. I could do:
lista_de_dados = [['nome', 'prioridade', 'hora', 'consultório', 'Número na fila'],
['Gabriel', 'Comum', '16:30', 'Dermatologia', 1],
['Gabrielle', 'Preferencial', '16:31', 'Dermatologia', 2]]
lista_de_dados.__delitem__(2)
print(lista_de_dados)
Will show on screen:
[['nome', 'prioridade', 'hora', 'consultório', 'Número na fila'], ['Gabriel', 'Comum', '16:30', 'Dermatologia', 1]]
However, how can I delete the same item (the list with Gabrielle’s information) without knowing its position in the data list? For example, I only know what is inside the list that contains Gabrielle’s information but I don’t know her position regarding the data_list.