Results for “and”

Showing 121–130 of 233

  1. 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.

    Write the code Medium 3 stages strings count multi-line strings logs
  2. Challenge

    Redact the access code

    …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.

    Write the code Medium 2 stages strings slicing len replace
  3. Challenge

    Packing crates

    …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.

    Write the code Medium 2 stages floor division modulo rounding up //
  4. Challenge

    Edge cases

    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…

    Write the code Medium 2 stages testing assert edge cases None
  5. Challenge

    Airlock permissions

    …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…

    Write the code Medium 2 stages sets subset difference permissions
  6. Challenge

    Retry the uplink

    …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.

    Write the code Medium 2 stages for loop range break retry
  7. Challenge

    Sorted copy

    …stays exactly as it was, then sort names like de Vries and van Dijk correctly with key=str.lower.

    Write the code Easy 2 stages lists sorted sort key
  8. Challenge

    API response

    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…

    Write the code Easy 2 stages dictionaries keys items JSON