-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotas alunos.py
More file actions
54 lines (54 loc) · 1.8 KB
/
notas alunos.py
File metadata and controls
54 lines (54 loc) · 1.8 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
fin = list()
sec = list()
nome = list()
notas = list()
nome1 = ''
nota1 = nota = media = 0
while True:
nome1 = str(input('Nome do Aluno: '))
nome.append(nome1)
nota = float(input('Primeira Nota do Aluno: '))
while nota > 10 or nota < 0:
print('Valor inválido. Notas devem variar de 0 a 10 com uma casa decimal.')
nota = float(input('Primeira Nota do Aluno: '))
nota1 = float(input('Segunda nota do Aluno: '))
while nota1 > 10 or nota1 < 0:
print('Valor inválido. Notas devem variar de 0 a 10 com uma casa decimal.')
nota = float(input('Primeira Nota do Aluno: '))
media = (nota + nota1) / 2
notas.append(nota)
notas.append(nota1)
notas.append(media)
sec.append(nome[:])
sec.append(notas[:])
fin.append(sec[:])
nome.clear()
notas.clear()
sec.clear()
resp = str(input('Deseja continuar? [S/N]'))
if resp not in 'SsNn':
print('Entrada Inválida. Digite "S" para "Sim" ou "N" para "não".')
resp = str(input('Deseja Continuar? [S/N]'))
if resp in 'Nn':
break
aluno = list(enumerate(fin))
count = 0
for e in aluno:
print(f' Para ver os dados de {aluno[count][1][0][0]} digite {aluno[count][0]}')
count += 1
while True:
select = int(input('\nDeseja ver os dados de qual aluno (Digite 999 para parar)? '))
if select > len(fin) - 1 and select != 999:
print('\nEntrada Inválida, por favor, digite o número correspondente a um aluno.')
if select == 999:
break
if select < len(fin):
print('-=' * 40)
print(f'''
O desempenho do aluno {aluno[select][1][0][0]} foi:
Primeira nota: {aluno[select][1][1][0]}
Segunda nota: {aluno[select][1][1][1]}
Média foi: {aluno[select][1][1][2]}
''')
count += 1
print('-='*40)