Challenge
Copy-pasted blocks
…with for name, level in tanks: and keep one copy of the if / else , with name in place of the letter. A fourth tank A fourth tank has been fitted. Add tank_d = 9.75 under tank_c and one more pair to…
Showing 21–30 of 63
Challenge
…with for name, level in tanks: and keep one copy of the if / else , with name in place of the letter. A fourth tank A fourth tank has been fitted. Add tank_d = 9.75 under tank_c and one more pair to…
Challenge
…length can't be negative: {burn_s} s") inside an if , before the calculation. A burn of 0 seconds is allowed. Raise TypeError A burn length read from a file arrives as the text "40" , and the function…
Challenge
…In the loop: record = parse_line(line) , then append it if record is not None .
Challenge
…every record, print only the records of the wanted sensor. If there are none, say so: Records: 4 ENG-2 at 09:30:05: 412.5 C ENG-2 at 09:30:10: 415.0 C With wanted = "GYRO-X" , the last line is No…
Challenge
…3 Start delay_s = 2 before the loop. After a failure, if attempt < MAX_ATTEMPTS , print the wait and double delay_s . (The simulator only prints the wait; real code would call time.sleep(delay_s) .)
Challenge
…that the crew member holds every permission in needed . If not, print what is missing, sorted: Kowalska can't depressurise the airlock: missing eva_certified needed <= granted is True when every item…
Challenge
…and end the countdown there, even at a second with a hold. If it reaches the end, print Liftoff! : T-10 T-9 T-8 T-7 HOLD at T-7 T-6 T-5 T-4 T-3 HOLD at T-3 T-2 T-1 T-0 Liftoff! With scrub_at = 4 , the…
Challenge
…. Then work out how many "waiting" lines there would be if second went up by 1 each time, and store it in waiting_lines . Remove any lines you added before you check. Modify. Make the loop move on to…
Challenge
A 70-line engine report repeats the same twelve lines for each engine. Restructure it into parse_feed() and summary_line() with the output unchanged to the character, then add assert tests that would…
Challenge
Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.