-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab3c.py
46 lines (34 loc) · 1.04 KB
/
lab3c.py
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
matricula = []
trab1 = []
trab2 =[]
p1 = []
p2 = []
p3 = []
n = input("Digite a quantidade de alunos:")
for i in range(int(n)):
print("Digite a matricula do aluno ", i+1, ":")
x = input()
matricula.insert(int(n), int(x))
print("Digite a nota do tabalho 1 do aluno ", i+1, ":")
x = input()
trab1.insert(int(n), x)
print("Digite a nota do tabalho 2 do aluno ", i+1, ":")
x = input()
trab2.insert(int(n), x)
print("Digite a nota da prova 1 do aluno ", i+1, ":")
x = input()
p1.insert(int(n), x)
print("Digite a nota da prova 2 do aluno ", i+1, ":")
x = input()
p2.insert(int(n), x)
print("Digite a nota da prova 3 do aluno ", i+1, ":")
x = input()
p3.insert(int(n), x)
fp = open("notas.txt", "w")
for i in range(int(n)):
fp.write("%d " %matricula[i])
fp.write("%.2f " %float(trab1[i]))
fp.write("%.2f " %float(trab2[i]))
fp.write("%.2f " %float(p1[i]))
fp.write("%.2f " %float(p2[i]))
fp.write("%.2f\n" %float(p3[i]))