This backpack is heavy! Each thing is noted as (name, grams). Write heaviest(items) to return the name of the heaviest thing. No two weigh the same; an empty bag gives None (already in the starter).
heaviest([("book", 800), ("water", 500), ("laptop", 1500)])→'laptop'heaviest([])→Nonedef heaviest(items):
if not items:
return None
# your code here: max with a key, by the grams (the 2nd part)
top = items[0]
return top[0]
Run tries the examples. When they look right, Submit.