0
Write a program that receives as many entries as the user wants and then create a new contact for each entry (Name, Phone, Address, Email), and finally prints, in alphabetical order, the contact book :
Nomes = []
Telefones = []
Endereços = []
Emails = []
Agenda = {"Nome": Nomes,"Telefone":Telefones,"Endereço":Endereços, "Email": Emails}
entrada = ""
while entrada != "s":
print("Bem-vindo a nossa Agenda!!!!!")
nome = input("Digite o nome: ")
Nomes.append(nome)
telefone = input("Digite o telefone: ")
Telefones.append(telefone)
endereço = input("Digite o endereço: ")
Endereços.append(endereço)
email = input("Digite o email: ")
Emails.append(email)
print(Agenda)
entrada = input("Deseja sair? ")
if entrada.lower() == "s":
print(Agenda)
break
The agenda is a dictionary and it has no ordination! How can I print the calendar in alphabetical order of names, followed by other information (Phone, Address, Email) ?
What makes the zip? I don’t understand
– Ed S
The agenda is not in alphabetical order of names!
– Ed S
The zip serves to aggregate the elements of an iterator. In this case he takes a position from his lists, for example, position 0, and gathers them into a list of tuples, where each tuple is a contact. The for loop traverses each tuple and displays its contents.
– Marcelo Magalhães