Results for “python dict”

Showing 11–20 of 37

  1. Challenge

    Log analyser

    …mission log into answers: parse each line into a dict, count the entries per level and per hour, find the first ERROR, then rank the subsystems by how many warnings they raised.

    Write the code Hard 3 stages project logs parsing Counter
  2. Challenge

    Counter

    …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 most_common().

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

    JSON out

    Turn the day's mission summary dict into JSON text with json.dumps() and indent=2, see what True, False and None become, then keep the station's Polish letters readable and sort the keys so the files…

    Write the code Easy 2 stages json json.dumps modules import
  4. Challenge

    Parser function

    …to record" into parse_line(line), which returns the record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.

    Fix the code Medium 2 stages functions return dictionaries None
  5. Challenge

    Lookup table

    …that maps planets and the Moon to surface gravity with a dict and one get() lookup, keeping the output exactly the same, then loop over the dict for a weight table.

    Fix the code Medium 2 stages dictionaries refactoring lookup tables get
  6. Challenge

    Telemetry pipeline

    …flag, save. Validate the rows Read telemetry.csv with csv.DictReader . Reject a row whose sensor is not in LIMITS , or whose value is not a number, with its line number in the file: the header is line…

    Write the code Hard 3 stages project csv json files
  7. Challenge

    Settings with defaults

    …True alerts: all DEFAULTS.copy() makes a separate dict, and settings.update(user_settings) overwrites the keys the user set. Unknown settings A user's profile has a typo: "dark_mod" . With update() it…

    Write the code Medium 2 stages dictionaries copy update defaults
  8. Challenge

    Config loader

    …= "DEBUG" retries = 12 safe_mode = "yes" timeout_s = 2.5 dict(DEFAULTS) makes the copy and update() fills it in. json.dumps(value) shows the difference between "256" and 256 . Every problem at once…

    Write the code Hard 3 stages project json configuration validation