Results for “warning”

9 results

  1. Challenge

    Count warnings

    …mission log: how many entries, and how many of them are warnings. A sudden jump in warnings is often the first sign that something is going wrong. Count them, make sure the count can't be fooled, then…

    Write the code Medium 3 stages strings count multi-line strings logs
  2. Challenge

    Logging instead of print

    …for its level: logging.debug() , 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…

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

    Clear error messages

    fuel_needed() quietly returns negative fuel for 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…

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

    Names with values

    …the three lengths are equal, and if they aren't, print a warning first: Warning: 4 sensors, 3 readings, 4 units ENG-1: 398.0 C ENG-2: 412.5 C TANK-1: 78.3 % len(sensors) == len(readings) == len(units)…

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

    Filter the log

    …screen shows only the entries that need attention: warnings and errors. Build that filtered list from the log, then make the filter adjustable, as real logging tools do. Warnings and errors only Build…

    Write the code Medium 2 stages for loop lists append filtering
  6. Challenge

    Entries per level

    …how many entries of each level it had. A sudden jump in warnings says more than any single entry. Count the entries per level, then make the count survive a level nobody planned for. Three counters…

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

    First error

    …start=1) . Look for "] ERROR" , as in "Count warnings", so a message that only mentions the word doesn't count. break ends the loop. How far it looked Show how much of the log the search needed: count…

    Write the code Easy 2 stages for loop break enumerate flags