-2
Can anyone help me? I’m having a hard time doing this exercise.
Consider the following data set: Name + (N1, N2, N3, N4). Name represents the name of a student and should be used as key. N1, N2, N3, N4 represent the This student’s test notes. Use a dictionary structure with lists to solve this exercise. Write a program that reads the data of N students and present on the screen if gone approved or failed. The criterion guaranteeing approval is that the arithmetic mean of 4 grades greater than or equal to 7.0. The value of N is the number of students, and this value must be read from the keyboard at the beginning of the program. Make a repeat loop for reading these N students. Grades should be displayed at the end of the program with a decimal precision.
This is the code I’m making.
n = int(input('Quantos alunos? '))
nome = {}
notas = []
i = 0
while i < n:
nome['Aluno'] = str(input('Nome do aluno: ')).capitalize().strip()
n1 = float(input('1ª nota: '))
notas.append(n1)
n2 = float(input('2ª nota: '))
notas.append(n2)
n3 = float(input('3ª nota: '))
notas.append(n3)
n4 = float(input('4ª nota: '))
notas.append(n4)
nome['Notas'] = notas
media = (n1 + n2 + n3 + n4) / 4
if media >= 7:
nome['status'] = 'Aprovado'
else:
nome['status'] = 'Reprovado'
i += 1
continue
for i in nome['Notas']:
for j, k, l in nome.values():
print('{} {} {} '.format(nome['Aluno'],nome['Notas'],nome['status'], end=''))
Thank you so much for your help, I understand where I went wrong. God bless you
– Lucas Soares