I have a question on the following question:
The ages and heights of K students were noted. Make a Program that determine how many students over the age of 13 have a height below average height of all students. The entry must contain an N number in the first line that indicates the number of students in the test case. In then each line contains age and height.
My code looks like this
idade = []
altura = []
somaAltura = []
cont = 0
qntAlunos = int(raw_input('Informe a quantidade de alunos: '))
for i in range(qntAlunos):
print 'Informe a idade:'
idade.append(int(raw_input()))
print 'Informe a altura:'
altura.append(float(raw_input()))
somaAltura = sum(altura)
media = somaAltura / qntAlunos
for j in range(qntAlunos):
if altura[j] < media and idade[j] > 13:
cont += 1
print cont
But when I run the program, does the counter never give the correct answer?