Challenge
One orbit short
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.
Showing 1–10 of 36
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.
Challenge
…ERROR Fuel valve 2 still closed Start with alerts = [] , loop over the log, and append() each line that contains "] WARN" or "] ERROR" . The log itself must stay complete. A minimum level Make the…
Challenge
Extend the OK/WARN/CRITICAL check from Alert level so a for loop runs it over every temperature in a list, then count the WARN and CRITICAL readings for a summary line.
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
Print one cargo manifest line for every record in a list of dicts, reading each field by key, then add up the masses in the same loop for a total line.
Challenge
…list with extend(), then fetch page after page in a while loop and stop at the first short page, the way paginated API responses are read.
Challenge
A while loop waits for the antenna signal but never moves on to the next reading, so it never ends. Predict it, find the stuck counter, fix it, then write a wait that gives up when the readings run…
Challenge
…blocks with a list of (name, level) pairs and one loop, keeping the output exactly the same, then add a fourth tank with a single list item and list the low tanks.
Challenge
…CABIN: 101.2 kPa 09:30:10 ENG-2: 415.0 C At the top of the loop, strip the line, then continue when it's empty or starts with # . Stripping first matters: one comment is indented, and a line can hold…
Challenge
…line, and a parser has to handle every line the same way. Loop over the lines, split each one, and print what the flight controllers need. Line by line Go through the feed line by line, split each…