Quiz
Python Strings Quiz
…on joining, indexing, slicing, len(), split(), join() and string methods, with instant answers.
Showing 31–40 of 233
Quiz
…on joining, indexing, slicing, len(), split(), join() and string methods, with instant answers.
Quiz
…15 questions on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.
Challenge
…lock on. The waiting code should print a line each second and then report the lock. Instead, the ground station screen fills with the same line, over and over, until someone stops the program. Predict…
Example
Local variables exist only inside functions. Global ones are accessible everywhere.
Challenge
An operator types 42,5 and float() crashes with a ValueError. Predict it, find out why, accept both commas and dots with replace(), then read pressures written like 1 013,25.
Challenge
…over a copy of the defaults, check each value's type and range and report every problem in one go, then wrap it all in a load_config() that never crashes, even on broken JSON.
Challenge
Build eng-2_2026-03-14.csv from a sensor ID and a date, then turn a name like Star Tracker A into a safe file name, and put the file in a folder of its own.
Challenge
Turn the bare 9.81 and 1000 in a weight report into named constants without changing the output, then write a Mars version with constants from the start.
Challenge
A cargo calculation uses a, b, x2 and tmp. Predict it, work out what each name holds, rename them so the code explains itself, then write a fuel check with good names.
Challenge
…report for the shift handover, with aligned columns and a totals line, then save the same data as a CSV file with csv.DictWriter for the spreadsheet people.