Unit: Unit 5: Dictionaries and Sets • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Iterate over key-value pairs using items() and tuple unpacking
student_grades = {
"Ada": 98,
"Alan": 95,
"Grace": 99,
"Linus": 92
}
print("Student Grade Report:")
# Unpack each (key, value) tuple directly in the for loop
for student, score in student_grades.items():
print(f"- {student}: {score}%")