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.
Showing 11–14 of 14
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
A loop over range(1, 10) logs nine orbits of a ten-orbit flight. Predict the last line, find out where range() stops, fix it with ORBITS + 1, then list every third orbit with a range() step.
Article Python Fundamentals
…data, format cosmic measurements, and create mission logs with this essential programming tool.
Challenge
…back. The fuel logger In a bigger program, every module logs. Give this code its own logger, log = logging.getLogger("fuel") , log through it, and add its name to the format with %(name)s . Switch on…