4
It is possible to display the name of only one key of a dictionary? ex:
notas_por_materias = { "Matematica" : 7,
"Portugues" : 8,
"Historia" : 10 }
I can display a print showing the subject name and then her note? Ex:
print (f"Sua nota em {Matematica}, foi de {nota_por_materias["Matematica"]}")
I can display the value of the note, but I cannot do the same with the name of the subject. I tried to pass as index [0] and as notas_por_materias.keys(0)
, but without success. I know there are many other ways to do this, but as I am learning to use dictionaries, I would like to know how to display through them.
I was able to understand the mistake, thank you for your help!!
– Pedro Henrique