Challenge
Debris grid
Scan a radar grid stored as a list of strings with a loop inside a loop, print the row and column of every # with enumerate(), then turn the loops around to find the columns that are clear all the way…
Showing 1–10 of 36
Challenge
Scan a radar grid stored as a list of strings with a loop inside a loop, print the row and column of every # with enumerate(), then turn the loops around to find the columns that are clear all the way…
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
Build the station's weekly shift rota: three shifts a day, the crew taken in turn so nobody works two shifts in a row, with a check that proves it, then plan around days off while keeping the work…
Challenge
Extend the feed parser from "Skip blanks and comments": a faulty sensor sends ERR and float() stops the program. Skip lines that fail to convert and count them, then let one try cover short lines too…
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
…on line 4: [T+00:14:47] ERROR Fuel valve 2 not responding Loop with enumerate(log, start=1) . Look for "] ERROR" , as in "Count warnings", so a message that only mentions the word doesn't count. break…
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
…each field by key, then add up the masses in the same loop for a total line.
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
Print each sensor name with its reading by looping over two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at…