Challenge: Class Grades
Practice combining lists, dictionaries, and loops by creating a list of students where each student has a name and a score. Learn to access and print student information using Python data structures and iteration.
We'll cover the following...
We'll cover the following...
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"]