0
I’m doing a student grade exercise, receiving a str with the student’s name, then int to know the grades(n1,N2,N3,N4). I made a while true, so it will always ask, until the user asks to quit, because the program drops asking if you want to continue with s/n.
while True:
aluno_nome = str(input("Digite o nome do aluno:"))
aluno = print("Digite notas aluno.")
n1=int(input("Nota 1:"))
n2=int(input("Nota 2:"))
n3=int(input("Nota 3:"))
n4=int(input("Nota 4:"))
final = (n1+n2+n3+n4)/4
#print("Aluno ",aluno_nome,"\nNota Final:",media)
sai = str(input('\nDeseja continuar[S/N]?').lower())
while sai != 's' and sai != 'n':
sai = str(input('Deseja continuar[S/N]?').lower())
if sai in 'n':
break
print("\nAluno ",aluno_nome,"\nNota Final:",final)
I want to know the easiest way, to print at the end the name of each student, and the grade of the same, such student in such, such student grade. I have to actually create a variable for each name and so save each of the 4 notes inside, but I can’t do it more "clean" with while true, and and do some counter to go creating and storing the name and final grade of the student.
Do you want to show at the end of the loop a list of all input students and their final average? Would that be it?
– Igor Cavalcanti