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.
Showing 11–20 of 20
Challenge
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.
Challenge
…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'…
Challenge
…, 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…
Challenge
…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…
Challenge
…saying what it returns and what the reserve means. The output doesn't change: Burn 1: 330.0 kg Burn 2: 135.0 kg For example: """Fuel in kg for an engine burn, including a reserve. The reserve is a…
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
…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…