Posts by Marcelo Magalhães • 56 points
2 posts
-
2
votes4
answers365
viewsA: Repetition for calling variables
One option is to use Dict comprehensions. Change the range value and increase the number of variables: d = {'f' + str(i): 0 for i in range(5)} Produces the following output: {'f0': 0, 'f1': 0, 'f2':…
-
2
votes2
answers942
viewsA: How to write an alphabetical agenda of Names, if the dictionary structure has no order?
nomes = [] telefones = [] endereços = [] emails = [] Agenda = {"Nome": nomes, "Telefone": telefones, "Endereço": endereços, "Email": emails } entrada = "" while entrada.lower() != "s":…