Challenge: Class Grades
Explore how to manage class grades by creating a list of students and their scores. Learn to print personalized messages based on data and understand building reusable code structures to handle such tasks efficiently.
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"]