grades=[]
ClassGrade=[]
NumStudents=int(input(" How Many Students Do You Have ? "))
for i in range(0,2,1):
prompt=("Input student "+str(i)+"'s grades ")
for i in range(0,2,1):
grade=float(input(prompt))
grades.append(grade)
ClassGrade.append(grades)
print(ClassGrade)
when start inputting the elements for example student 1 : [56,80] and student 2:[90,66]
and i append grades to classGrade when i print out classGrade i get [[56,80,90,66],[56,80,90,66]]
when i'm actually expecting classGrade to be [[56,80],[90,66]]
You should declare the array inside the for loop, or you will add all the grades to the same list:
you need to move
grades=[]from here:to: