Challenge
Last five readings
…The list is oldest first, so the most recent are at the end. A negative start counts from the end, as with strings. The window moves A new reading has arrived. Add new_reading = 772 under the list…
Showing 21–30 of 56
Challenge
…The list is oldest first, so the most recent are at the end. A negative start counts from the end, as with strings. The window moves A new reading has arrived. Add new_reading = 772 under the list…
Challenge
…T , at index 11, and is 8 characters long. In text[start:end] , the character at end isn't included. The way we write it In Poland and much of Europe, dates are written day first, with dots…
Challenge
…show: Command: [launch] strip() removes spaces from both ends and lower() turns capitals into small letters. You can call one straight after the other: typed.strip().lower() . Does it match? Now check…
Challenge
…Because the names are all different lengths, the states end up scattered across the screen, and a HOLD is easy to miss. Line the states up in a column. Format specs can give each value a fixed width…
Challenge
The engine sensors on Python One send readings that end up in a CSV file: one reading per line, with commas between the values. Spreadsheets, databases and data tools all read CSV, which is why it's…
Challenge
At the end of every day, the outgoing shift leaves a report for the incoming one: each subsystem, its status, its alerts and how much of the day it was up. People read it on a screen in a fixed-width…
Challenge
…the error, fix it, and run again, until it runs to the end. Four bugs stop it: a syntax error, a type error, a missing key and an index out of range. Fix each one where the error points, without…
Challenge
…allowed and must give None . Keep the passed line at the end. The hidden tests now plant all three bugs, the third being >= instead of > in check_limits() .
Challenge
…and that 40 s needs 500.0 kg. Keep the passed line at the end. The hidden tests now also try a version that refuses 0, one with a vague message, and one that refuses every length.
Challenge
…Three of the four readings look like numbers. How many end up in good ? Investigate and modify Investigate. Change except: to except Exception as error: and print type(error).__name__ in it, to see…