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.
Showing 1–10 of 17
Challenge
…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.
Challenge
The flight log script won't run. Read the error message, go straight to the line it names and fix it. Learn to debug Python syntax errors the way programmers do.
Challenge
…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.
Challenge
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.
Challenge
…it joins text and a number with +. Predict it, read the error, fix it with str(), then build a docking status line.
Challenge
…count the entries per level and per hour, find the first ERROR, then rank the subsystems by how many warnings they raised.
Challenge
…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…
Challenge
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.
Challenge
…then let one try cover short lines too and print each error.
Challenge
…own parameter names. Then print(format_log(elapsed, level, message)) . One change for every line The function is now used for a whole orbit's entries, and ERROR is five letters long, so its messages…