Challenge: Class Grades
Let’s practice working with lists, dictionaries, and loops together.
Create a list of students, where each student has a name and a score. Then loop through the list and print a message for each student.
Your task:
Create a list called
studentsEach item should be a dictionary with:
"name"→ the student’s name"score"→ their test score
Use a
forloop to print a message like the following for all students:Sam scored 87
💡 Hint: You’ll access dictionary values using square brackets, likestudent["name"]
Challenge: Class Grades
Let’s practice working with lists, dictionaries, and loops together.
Create a list of students, where each student has a name and a score. Then loop through the list and print a message for each student.
Your task:
Create a list called
studentsEach item should be a dictionary with:
"name"→ the student’s name"score"→ their test score
Use a
forloop to print a message like the following for all students:Sam scored 87
💡 Hint: You’ll access dictionary values using square brackets, likestudent["name"]