Results for “error messages”

Showing 1–10 of 25

  1. Challenge

    Clear error messages

    …a negative burn length. Make it raise ValueError with a message that shows the bad value, then raise TypeError, checked first, when the length isn't a number at all.

    Write the code Medium 2 stages errors raise ValueError TypeError
  2. Challenge

    Test the error

    …so a version that returns a value or 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

    First error

    Scan the mission log for the first ERROR entry, print its line number with enumerate() and stop there with break, then report how many lines were checked, or that there were no errors at all.

    Write the code Easy 2 stages for loop break enumerate flags
  4. Challenge

    Log analyser

    …count the entries per level and per hour, find the first ERROR, then rank the subsystems by how many warnings they raised.

    Write the code Hard 3 stages project logs parsing Counter
  5. Challenge

    Logging instead of print

    …nobody needs. Switch to the logging module, where every message has a level and you decide which levels to show. Levels instead of prints Replace each print() with the logging call for its level…

    Fix the code Medium 2 stages logging debug info warning
  6. Challenge

    Search the log

    Check whether a mission log line contains ERROR with in, find where it starts with find(), including the -1 it gives when there is nothing to find, then slice out the error message.

    Write the code Medium 2 stages strings in find slicing