Quiz
Python Return Values Quiz
…quiz on Python return values: 15 questions on return, None, several values, lists, dictionaries and early exit. Instant answers.
Showing 11–20 of 39
Quiz
…quiz on Python return values: 15 questions on return, None, several values, lists, dictionaries and early exit. Instant answers.
Challenge
…shared default list, then add checks that a log passed in is still the one that gets the sample, so a "fix" that breaks that can't pass either.
Article Mini projects
…vulnerable to bulletproof—showing why trusting system time is dangerous.
Challenge
The telemetry pipeline is now split into parse_row() and check_limits(). Write assert tests for both, good rows, rejected rows and readings right at a limit, so that each of three planted bugs makes…
Challenge
status_light() returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function…
Quiz
…Python data types: 15 questions on int, float, str, bool, None, lists, tuples, dictionaries and sets, with instant answers.
Example
Parameters can have default values. Used when argument is not provided.
Challenge
…has a try and an except , so it can't crash, but the bug is hiding somewhere inside it. Predict what the program prints, find out what the except is catching, and make it catch only what it should…
Challenge
…3.7 m/s², a 92.5 kg astronaut weighs 342 N A body that isn't in the table still prints the no-data line: GRAVITY_M_S2.get(body) gives None for a missing key, just like the old else . The whole table…
Challenge
…you where to look. The fifth doesn't stop anything, and it is the most dangerous one. Make it run Run the program, read the error, fix it, and run again, until it runs to the end. Four bugs stop it: a…