Challenge
Skip blanks and comments
…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…
Showing 11–20 of 36
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
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
…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…
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
…a dead link doesn't block everything else. Write the retry loop against a simulator that plays back the radio's replies, then space the attempts out. Up to three tries Try up to MAX_ATTEMPTS times…
Challenge
…gives pairs of a number and an item. Unpack them in the loop: for number, item in enumerate(checklist, start=1): . Done or not yet The crew has done the first two items. Add completed = 2 under the…
Challenge
…line, and use a flag to decide about Liftoff! after the loop.
Challenge
…it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
…burn_kg) , which returns the fuel left, and use it in a loop over the planned burns, without global . Print: Burn of 180.0 kg, 1020.0 kg left Burn of 45.5 kg, 974.5 kg left Burn of 310.0 kg, 664.5 kg…
Challenge
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…