I am creating a program, using Python 3.5, to calculate average, but in my school there are some subjects with two teachers, and each one of a different proof.
The problem is that the code I created does the average of(Prova 1 + Prova 2)/2
, which is equal to media1
, (Atividade 1 + Atividade 2)/2
, which is equal to average 2, and the final average is with% and when it is a matter I do not put anything in P2 gives error. I was thinking, when the user enter the name of the subject run such code, and another name, another code, how do I do that?
My code:
nota1 = float(input("Nota1: "))
nota2 = float(input('Nota 2: '))
simulado = float(input('Nota simulado: '))
ac1 = float(input('Nota AC1: '))
ac2 = float(input('Nota AC2: '))
media1 = (nota1+nota2)/2
mediaAC = (ac1+ac2)/2
mediaf = (media1+simulado+mediaAC)/3
print (mediaf)
if mediaf == 6:
print("na media")
if mediaf < 6:
print("abaixo da media")