0
Will be passed as entry list with the current information of a contact, and the phone you want to delete:
• if the phone is in the contact’s phone list, it must be removed.
• if not, no update will be made.
What to do to get the expected output of the "exclusion" function?
def contato(nome,telefone='()',email='()',instagram='()'):
'''Dados nome, telefone, email e instragram-->str. Retorna uma lista com os dados informados'''
lista=[nome,[telefone],[email],[instagram]]
return lista
def exclusão(lista, telefone):
'''Dado o nome e numero de telefone, retorna a lista sem o numero de telefone informado'''
P= lista
B= telefone
A= P[1]
if (B in A):
del(lista[2])
return lista
if (B not in A):
return lista
# Entrada: contato('henrique','22222','nada','@123')
# Valor Esperado: ['henrique', ['22222'], ['nada'], ['@123']]
# Entrada: exclusão('henrique','22222')
# Valor Esperado: ['henrique',['nada'], ['@123']]
# Valor Obtido: 'henrique'
Please edit the question to limit it to a specific problem with sufficient detail to identify an appropriate answer.
–
Okay, I’ll put, thank you very much for your help
– Henrique Gonçalves Chaves
What is the question?
– Augusto Vasques
Good evening, the serious question= What to do to get the expected output from the "delete" function? Thank you very much for the help.
– Henrique Gonçalves Chaves