Complete the code to initialize the checklist status as all items unchecked.
checklist = {'battery': False, 'motors': False, 'gps': False, 'camera': False}
status = [1]The variable status should reference the checklist dictionary to track each item's check state.
Complete the code to mark the 'battery' check as done.
status['battery'] = [1]
The checklist uses boolean values to mark checks. True means the check is done.
Fix the error in the code that checks if all items are done.
if all(status[1]): print('Ready for takeoff')
all() can't evaluate directly.The all() function needs the values (True/False) to check if all are done.
Fill both blanks to update the checklist for items starting with 'c'.
for item in checklist: if item[1]'c'): status[item] = [2]
Use startswith('c') to find items beginning with 'c' and mark them as done with True.
Fill all three blanks to create a dictionary of checked items only.
checked_items = [1]: [2] for [3] in status.items() if [2] == True
This dictionary comprehension collects keys and values where the value is True, using {k: v for k, v in status.items() if v == True}.