I have the following statement:
A teacher takes measurements of the heights of his students in his class. For each of the 10 students, take the measurements twice a year. We will make a program that allows us to enter 10 height values (For the first measurement), and 10 values for the second measurement. the program will show us a list of the growth experienced for each student.
I have done this:
altura=[[],[],[],[],[],[],[],[],[],[]]
i=0
print(altura[i][i])
while i <= 10:
primera_altura=float(input("Introduce altura: "))
altura[i][i]=primera_altura
i=i+1
Obviously it does not work, what I'm trying to do is create a list that has 10 sublists for each student, and then ask the user for a height and add it to field i in the list, so each time you enter a height the will enter in another sublist. The problem is that it gives me an error message saying that it leaves the index of the list.
How could I do it?
Thank you very much.