Challenge
Count warnings
Count the entries and the WARN lines in a multi-line mission log with count(), fix the count when a message mentions WARN itself, then summarise the log by level.
Showing 121–130 of 233
Challenge
Count the entries and the WARN lines in a multi-line mission log with count(), fix the count when a message mentions WARN itself, then summarise the log by level.
Challenge
…characters of an access code with * using len(), slicing and string repetition, then find a code inside a log line and mask it there before the line is saved.
Challenge
…out how many 12-slot crates 100 sample tubes fill with // and %, then how many crates they need and how full the last one is, including the case where the tubes fit exactly.
Challenge
…any of its callers. Defaults Give retries a default of 3 and timeout a default of 5.0, so the three calls below the function print: PING (retries: 3, timeout: 5.0 s) DEPLOY_ARRAY (retries: 5, timeout…
Challenge
Write assert checks for mean(): an ordinary list and a list with one value first, then the edge cases, an empty list that should give None and lists with negative values, so broken copies of the…
Challenge
…to the commander's approval for opening the outer hatch, and the airlock's control panel checks them before it does anything. Check one action for one crew member, then the whole list of airlock…
Challenge
…taking each result from a list of simulated radio replies, and stop at the first success with break; then wait 2, 4, 8 seconds between attempts, as real retry code does.
Challenge
…stays exactly as it was, then sort names like de Vries and van Dijk correctly with key=str.lower.
Challenge
Print the name, provider and status of a launch from a dict shaped like a launch-API response, then list every field the response has with items(), the way you'd inspect an API you haven't used…
Example
Adding and removing elements from a set. Basic set operations.