Results for “output”

Showing 11–20 of 20

  1. Challenge

    Environment check

    Every useful bug report starts with the Python version. Ask Python for it with the platform and sys modules and print it the way python --version does.

    Write the code Easy 3 stages platform sys python version bug report
  2. Challenge

    Parser function

    …that returns the record dict, and call it in the loop. The output must stay exactly the same: Records: 4 {'time': '09:30:05', 'sensor': 'ENG-2', 'value': 412.5, 'unit': 'C'} {'time': '09:30:05'…

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

    Counter

    …, and replace the get() line with counts[level] += 1 . The output stays as it was: DEBUG: 2 ERROR: 1 INFO: 4 WARN: 3 Most common first Replace the sorted listing with one from the most common level…

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

    Statistics module

    …statistics.median() : Mean: 418.8 C Median: 413.8 C The output doesn't change: that is the point of a refactor. The check looks for the module and makes sure your own functions are gone. Spread, and…

    Fix the code Easy 2 stages statistics mean median stdev
  5. Challenge

    Log formatter function

    …that returns the log line, and print what it returns. The output must stay exactly the same: [T+00:12:05] INFO Engines nominal Define the function at the top: def format_log(t, level, msg): , with…

    Fix the code Easy 2 stages functions def return refactoring
  6. Challenge

    Filter the log

    …more serious, and use min_level in the first line of the output: LEVELS = ["INFO", "WARN", "ERROR"] # from least to most serious min_level = "WARN" # show this level and above WARN and above: 4…

    Write the code Medium 2 stages for loop lists append filtering
  7. Challenge

    Path in a config

    …writes them. Raw string Run the script and look at the output: the path is split across two lines, with a strange gap in the middle. Fix the path so the script prints: Telemetry file…

    Fix the code Easy 2 stages raw strings escape sequences paths print
  8. Challenge

    Broken boot script

    …Run it, read the error and fix the line it names. The output must be: Booting flight computer... Checking fuel sensors... OK Checking star tracker... OK Boot complete One error at a time The last part…

    Fix the code Easy 3 stages SyntaxError debugging print quotes
  9. Challenge

    Wrong line commented out

    …out the debug line. Leave everything else as it is. The output: Checking cabin pressure... OK Checking oxygen supply... OK Checking engine 1 igniter... OK Checking engine 2 igniter... OK Checking fuel…

    Fix the code Easy 2 stages comments debugging print