Results for “print function”

Showing 1–10 of 39

  1. Challenge

    Prints instead of returns

    to_kelvin() prints its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that…

    Fix the code Easy 3 stages functions return print None
  2. Challenge

    Log formatter function

    …mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.

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

    Summary function

    In "Readings summary" you printed the min, max and mean of one pass. Now the dashboard, the daily report and the alert system all need those numbers, each in its own format, for every pass, including…

    Write the code Medium 2 stages functions return dictionaries min
  4. Challenge

    Parser function

    …in one place and not the other. Turn the parsing into a function that any program can call, then let it decide on its own which lines are worth a record. parse_line() Move the parsing of one line into…

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

    Read the traceback

    …Read it from the bottom up to find the error, the function and the line, fix the bug there, then follow a longer traceback through four calls to a second bug.

    Fix the code Easy 2 stages errors traceback KeyError TypeError
  6. Challenge

    Shadowed fuel

    refuel() assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write…

    Fix the code Medium 3 stages functions scope local variables global variables