Results for “print”

Showing 221–230 of 237

  1. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  2. Challenge

    Packing crates

    Work 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 //
  3. Challenge

    Alert deduplicator

    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…

    Write the code Hard 2 stages project dictionaries tuples as keys grouping
  4. Challenge

    Counter

    Refactor the level counter from "Entries per level": replace the dict and counts.get() with collections.Counter, which starts every key at 0, then list the levels from most to least common with…

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  5. Challenge

    Extra log fields

    Extend format_log() from "Log formatter function" with **fields, so any extra keyword arguments are added to the line as key=value pairs, then pass whole dicts of fields into it with ** at the call.

    Write the code Medium 2 stages functions **kwargs keyword arguments dictionaries