Challenge
Names with values
Print each sensor name with its reading by looping over two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at…
Showing 21–27 of 27
Challenge
Print each sensor name with its reading by looping over two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at…
Challenge
readings[5] on a list of five readings stops with an IndexError. Predict it, work out the valid indexes with len(), fix it with [-1], then print the first, middle and last readings for any length.
Challenge
…missing eva_certified needed <= granted is True when every item of needed is in granted . needed - granted is what's missing. Every action The control panel shows every airlock action at once. ACTIONS…
Challenge
A call to schedule_launch() passes the pad where the rocket belongs, and the board says a launch pad is flying. Predict the line, find which parameter got which value, fix it with keyword arguments…
Challenge
…832 N Uranus: 805 N Neptune: 1018 N Loop over GRAVITY_M_S2.items() ; the weight is the mass times the gravity.
Challenge
The manifest changes every day as items are packed and unpacked. The loading supervisor doesn't want to read both lists side by side: she wants to know what changed. Work out what was added and what…
Challenge
…Take them out with pop() , which gives the removed item back, and print who it was before the roster: Reassigned: Moreau Roster: Okafor, Haddad, Lindqvist, Kowalska Crew size: 4