-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExercicio 89.py
More file actions
27 lines (27 loc) · 845 Bytes
/
Copy pathExercicio 89.py
File metadata and controls
27 lines (27 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Cadastro de alunos com 2 notas e analise no final
alunos = []
estudante = []
notas = []
while True:
estudante.append(str(input('Nome do aluno :')))
for c in range(1, 3):
notas.append(float(input(f'Nota {c} :')))
estudante.append((notas[0] + notas[1]) / 2)
estudante.append(notas[:])
notas.clear()
alunos.append(estudante[:])
estudante.clear()
conti = str(input('Deseja continuar? [S/N]')).strip().lower()[0]
if conti in 'nN':
break
print(f'{"No":<4} {"NOME":<10}{"MÉDIA":>8}')
print('-' * 23)
for no, a in enumerate(alunos):
print(f'{no:<4} {a[0]:<10} {a[1]:>5}')
while True:
NotaAluno = int(input('Mostrar nota de qual aluno? '))
if NotaAluno == 999:
break
print('-' * 30)
print(f'A nota de {alunos[NotaAluno][0]} é {alunos[NotaAluno][2]}')
print('-' * 30)