Results for “sort”

Showing 11–20 of 27

  1. Challenge

    JSON out

    …then keep the station's Polish letters readable and sort the keys so the files compare easily.

    Write the code Easy 2 stages json json.dumps modules import
  2. Article Mini projects

    Medical dispenser - Don’t trust the user

    …event_string = json.dumps(event_copy, sort_keys=True) expected_hmac = self._compute_hmac(event_string) if expected_hmac != stored_hmac: raise ValueError(f"HMAC verification failed at event {i}")…

  3. Challenge

    Counter

    …in, then use the one thing a plain dict can't do for you: sort by count. Counter() Import Counter from collections , start with counts = Counter() , and replace the get() line with counts[level] += 1…

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

    Airlock permissions

    …permission in needed . If not, print what is missing, sorted: Kowalska can't depressurise the airlock: missing eva_certified needed <= granted is True when every item of needed is in granted . needed…

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

    Undo and history

    Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.

    Write the code Hard 2 stages project lists stack append
  6. Challenge

    Log analyser

    Turn the launch-day 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
  7. Challenge

    Config loader

    Load the downlink module's JSON settings over a copy of the defaults, check each value's type and range and report every problem in one go, then wrap it all in a load_config() that never crashes, even…

    Write the code Hard 3 stages project json configuration validation
  8. Challenge

    Statistics module

    Refactor the temperature summary: delete the hand-written mean() and median() and use statistics.mean() and statistics.median() instead, then add the standard deviation and handle passes with too few…

    Fix the code Easy 2 stages statistics mean median stdev