Results for “errors”

Showing 11–20 of 55

  1. 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
  2. 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
  3. Challenge

    Filter the log

    …mission log and build a new list holding only the WARN and ERROR entries with append(), then let a minimum level decide what counts, the way logging tools filter by severity.

    Write the code Medium 2 stages for loop lists append filtering
  4. 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
  5. Challenge

    Logging instead of print

    …, logging.info() , logging.warning() or logging.error() , and drop the level from the text, since the format adds it. With the level set to INFO , the debug lines disappear: INFO TANK-1 ok: 78.3%…

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

    Entries per level

    Count the mission log's entries per level, INFO, WARN and ERROR, in a dict of counters, then count any level at all with get() when DEBUG lines turn up, and print the levels in alphabetical order.

    Write the code Easy 2 stages dictionaries counting get sorted
  7. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  8. Challenge

    Launch counter crash

    …launch day, the first launch stopped the program with an error nobody had seen before. Predict what happens, find out why, then fix it in a way that keeps the function independent of the rest of the…

    Fix the code Medium 3 stages functions scope UnboundLocalError global