Challenge
Flight software review
…check has five bugs: a syntax error, a type error, a wrong key, an index out of range and a reversed decision. Read each error to fix the four that crash, then find the one that runs but gives the…
Showing 11–20 of 62
Challenge
…check has five bugs: a syntax error, a type error, a wrong key, an index out of range and a reversed decision. Read each error to fix the four that crash, then find the one that runs but gives the…
Challenge
…then let other code pick out one sensor's readings by key.
Quiz
Free beginner quiz on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Quiz
…on local and global variables, the global and nonlocal keywords, and nested functions.
Quiz
…and fix – NameError, TypeError, ValueError, IndexError, KeyError, IndentationError and ZeroDivisionError.
Challenge
…loose values and with a list unpacked by *, then add a keyword-only decimals option after *values and return None when there are no values.
Challenge
The monitoring system raises the same alert over and over. Group repeats of an alert that come within 60 seconds of the first into one line with a count, in the order they first appeared, then add the…
Challenge
…(41%) crew: 3.4 kg (3%) spares: 2.4 kg (2%) sorted(totals, key=totals.get, reverse=True) gives the categories ordered by their totals. sum(totals.values()) is the whole load.
Challenge
…they haven't changed falls back, then warn about unknown keys instead of saving them.
Example
Looping through keys, values or key-value pairs of a dictionary.