Pick passing students and keep a backup
students is a list of dictionaries, each with a "name" and a "marks" number.
With a list comprehension, make passed: the names of students with marks of 50 or more, in the same order. With a dictionary comprehension, make by_name: each name mapped to that student's marks.
Make backup as a deep copy of students, using copy.deepcopy (the starter already has import copy at the top). Replace the line backup = students, which only gives the list a second name.
The last line of the starter, students[0]["grace"] = 5, adds a "grace" entry to the first student. Keep it after you make backup. backup must stay unchanged.
What Check tests
passedis["Asha", "Tom"]by_namemaps names to marks- The first student of
studentshas the grace entry backupis not changedbackupis a separate object with the same namesbackupshares no student dictionary withstudents
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Output
Press Run to see what your program prints.