Challenge
Sort by a field
…meals 31.3 kg CO2 scrubber cartridges 25.0 kg Rice and lentils 18.5 kg Water filter cartridges 3.4 kg Tablet computers 2.4 kg Spare cabin fan Write mass(item) , which returns item["mass_kg"] , and…
Showing 21–30 of 45
Challenge
…meals 31.3 kg CO2 scrubber cartridges 25.0 kg Rice and lentils 18.5 kg Water filter cartridges 3.4 kg Tablet computers 2.4 kg Spare cabin fan Write mass(item) , which returns item["mass_kg"] , and…
Challenge
A 40-line pre-burn check has five bugs: a syntax error, a type error, a wrong key, an index out of range and a reversed decision. Read each error to fix the four that crash, then find the one that…
Challenge
A small but complete data pipeline: read the telemetry CSV, reject rows with unknown sensors or broken values and say why, flag readings outside each sensor's limits, and save a JSON summary for the…
Challenge
Refactor the temperature summary: delete the hand-written mean() and median() and use statistics.mean() and statistics.median() instead, then add the standard deviation and handle passes with too few…
Challenge
…packing tool. Ask for the crew size, then the mission length in days, both whole numbers, and print the meals and water to pack: 3 meals and 2.5 litres of drinking water per person per day. For 4 crew…
Challenge
Parse the launch schedule from JSON, keep the launches still to come, sort them by their window and print a digest line for each with the time left and any hold, then switch the digest to the live…
Challenge
A bare except: reports every fuel reading as bad, because it also catches a NameError from a typo. Predict the last line, find the hidden error, catch only ValueError and fix the typo, then write a…
Challenge
A Python program stops with a traceback. Read it from the bottom up to find the error, the function and the line, fix the bug there, then follow a longer traceback through four calls to a second bug.
Challenge
Move the feed parser from "Line to record" into parse_line(line), which returns the record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
Write assert checks for parse_line() from "Parser function": the whole record for a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't…