Challenge
Prove the fix
…it stays fixed? Six months from now someone will tidy the function, and log=[] looks so much simpler than the None check. Write the test that proves the fix: it has to pass now and fail on the old…
Showing 31–39 of 39
Challenge
…it stays fixed? Six months from now someone will tidy the function, and log=[] looks so much simpler than the None check. Write the test that proves the fix: it has to pass now and fail on the old…
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…
Challenge
…with a ValueError . That refusal is part of what the function promises, as much as the arithmetic is, and like the arithmetic it can quietly break. Write the test that keeps it honest. The hidden…
Challenge
…the file back and print it, then add an append_entry() function that adds lines at the end without wiping what is there.
Challenge
…The check looks for the module and makes sure your own functions are gone. Spread, and too little data Now there are three passes. For each, print the mean, the median and the standard deviation…
Challenge
…the summary. Summarise the readings with Python's built-in functions, then make sure the summary survives a pass with no readings at all. Min, max, mean Print the lowest and the highest reading, and…
Challenge
…see your prediction next to what Python printed. The two functions handle the decimals differently. What does each one give for 1499.7? Investigate and modify Investigate. Store what int(2.9) gives in…
Challenge
…(ISRO) 2026-11-20 18:45 UTC Polaris Cargo 4 (NASA) A small function such as window(launch) , returning the parsed datetime, works for the comparison and as the key for sorted() . strftime("%Y-%m-%d…
Challenge
…has no brackets, because it's a value you read, not a function you call. The test shows the platform as <platform> .