# Uses dictionary comprehension instead students = ["Hermione", "Harry", "Ron"] gryffindors = [{"name": student, "house": "Gryffindor"} for student in students] print(gryffindors)