Hi, I've been doing exercises with the While condition, but I still have trouble understanding how the exercise works. It consists of entering 10 notes and saying the notes over 7 and under, I have guided myself with other exercises and I have managed to get it out ...
x=1 conta1=0 conta2=0 while x <= 10: notas= int(input("Introduce las notas")) if notas >= 7: conta1= conta1+1 else: conta2=conta2+1 x=x+1 print("Las notas mayores a 7 son",conta1) print("Las notas menores a 7 son",conta2)
My question is that does the sentence conta1 = conta1 + 1? < - Is this where the notes are stored? Why do we have to enter x = x + 1 at the end? Why is it necessary to initialize conta1 and conta2 from 0?