Quiz
Python print() Quiz
…on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.
Showing 21–30 of 202
Quiz
…on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.
Challenge
…status display was written in a hurry: one block of code for tank A, then the same block copied for B and C. It works, but every change has to be made three times, and the next tank means a fourth…
Challenge
…, the countdown ends like this: T-5 T-4 SCRUB at T-4 Check for the scrub before the hold, break after the scrub line, and use a flag to decide about Liftoff! after the loop.
Challenge
…pairs of a number and an item. Unpack them in the loop: for number, item in enumerate(checklist, start=1): . Done or not yet The crew has done the first two items. Add completed = 2 under the list…
Challenge
…cartridges | 18.5 kg Three names on the left of = , one for each value, in order. A new field The manifest now also records the module each item is stowed in. The starter code stops with ValueError…
Quiz
…(11 of 15) to pass New to conditions? Read Python If/Else for Beginners first, or run the examples: basic if statement , if-else , if-elif-else and logical operators and, or, not . After this one, try…
Challenge
…1,234,567 kg and a fuel fraction as a percentage, using format specs in f-strings.
Challenge
…a clear ValueError, then extend the table with offsets for temperatures.
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…
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…