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 students

  • Each item should be a dictionary with:

    • "name" → the student’s name

    • "score" → their test score

  • Use a for loop to print a message like the following for all students:
    Sam scored 87

💡 Hint: You’ll access dictionary values using square brackets, like
student["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 students

  • Each item should be a dictionary with:

    • "name" → the student’s name

    • "score" → their test score

  • Use a for loop to print a message like the following for all students:
    Sam scored 87

💡 Hint: You’ll access dictionary values using square brackets, like
student["name"]

Python
# Write your code here.