Results for “output”

Showing 21–30 of 32

  1. Article Python Fundamentals

    How to Start Programming in Python Fast

    …function, a fundamental tool in Python for displaying output. 4. Running Your Python Code Once you've written your code, it's time to see it in action! Here's how you can run your Python file…

  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. Article Python Fundamentals

    Nested Loops in Python

    …Rover {name} found at coordinates ({scan_x}, {scan_y})") Output might look like this: === MARS SURFACE MAP === ⚫ ⚫ ⚫ 🔴 ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ 🔴 ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫…

  4. 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
  5. 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
  6. 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
  7. 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
  8. 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