I'm creating a program that asks for the number of students, then asks for their names.
Ex:
Enter the test scores of the students:
> 4
When I use the same method for grades, it won't work (the final output desired is the name of the student next to the grade). My second loop doesn't seem to work.
Desired Output:
Enter the test scores of the students: 5
Bob
Tom
Obi
Eli
Brady (only lets me add 5 names)
Enter the test scores of the students:
100
99
78
90
87 (only lets me add 5 grades)
OUTPUT:
Bob 100
Tom 99
Obi 78
Eli 90
Brady 87
Here is the code I have tried:
students = []
scores = []
count = 0
count2 = 0
number_of_students = int(input("Enetr the number of students: "))
while count != number_of_students:
new_student = input()
students.append(new_student)
count = count + 1
if count == number_of_students:
break
print("Enter the test scores of the students: ")
while count2 != count:
new_score = input()
scores.append(new_score)
count2 = count2 + 1
if count == number_of_students:
break
What can I change?