Results for “and”

Showing 101–110 of 150

  1. Challenge

    Telemetry from CSV

    …a proper export, telemetry.csv , with a header row, and it changes every few seconds. Read the file itself, with the module made for it, then pick out the hottest reading. csv.DictReader Replace the…

    Write the code Medium 2 stages csv csv.DictReader files open
  2. Challenge

    Test the error

    …raises the wrong error fails it, then pin down the message and the lengths that must still work.

    Write the code Medium 2 stages testing assert try except
  3. 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
  4. Challenge

    Safe number input

    The burn length is typed in by hand, and a typo stops the program with a ValueError. Catch it with try and except, keep asking until the input is a number, then also turn away zero and negative…

    Write the code Easy 2 stages errors try except ValueError
  5. Challenge

    Survive bad lines

    Extend the feed parser from "Skip blanks and comments": a faulty sensor sends ERR and float() stops the program. Skip lines that fail to convert and count them, then let one try cover short lines too…

    Write the code Medium 2 stages errors try except ValueError
  6. Challenge

    Prove the fix

    …fixed? Six months from now someone will tidy the function, and log=[] looks so much simpler than the None check. Write the test that proves the fix: it has to pass now and fail on the old code. The…

    Write the code Medium 2 stages testing assert regression tests default values
  7. Challenge

    Copy-pasted blocks

    …tank-status blocks with a list of (name, level) pairs and one loop, keeping the output exactly the same, then add a fourth tank with a single list item and list the low tanks.

    Fix the code Medium 2 stages refactoring for loop tuples lists
  8. Challenge

    Names with values

    …lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at the shortest.

    Write the code Easy 2 stages for loop zip lists unpacking
  9. Challenge

    Missing reading

    …driver hands your alert check None instead of a number, and the check from "Alert level" stops with a TypeError in the middle of a pass. Extend your check so a missing reading is reported, not crashed…

    Write the code Medium 2 stages if else None is None