0
I have this issue to resolve, I need to display the note of the first name in the order of the flame, but I can only print the Key, the question is this:
Make a program in python that prompts the user to enter names and notes of 10 students. Next, the program should show the student note(a) that appears first in the call book.
my code so far:
dicionario = {}
for x in range(0, 3):
nome = input("\nInsira o nome do aluno: ")
nota = float(input("Insira a nota do aluno: "))
dicionario[nome] = nota
newdict = sorted(dicionario)
print(newdict[0])
how do I print only the value of the first key of the dictionary?
Thank you very much, put on output it prints key and value, I just wanted the value
– José Guilherme Lins
Just reference the value with
[1]
:print(newdict[0][1])
– Felipe Gambini