I want to remove the whole list where the name is, given by the user
import taskk
agenda = []
count = 0
while True:
print('---MENU---')
print('Register- 1 / Remove - 2')
option= int(input())
if option== 1:
name= input('Name:')
wpp = int(input('Number: '))
email = input('Digite o email: ')
contact= [name,wpp,email]
agenda.append(contact)
count +=1
if option == 2:
name = input('Who do you want to remove? ')
agenda.append(name)
if count == 2:
break
I want to do something like this, take the index from the name and add 1 to remove the name, wpp and email. I know it's wrong, but I figured I could do something like that
def remove(name, agenda = []):
for registro in agenda:
registro1 = agenda.index(name)
registro2 = agenda.index(name+ 1)
registro3 = agenda.index(name + 2)
agenda.pop(registro1, registro2, registro3)
return agenda
return