Challenge
Shadowed fuel
…to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write a function that…
Showing 21–30 of 150
Challenge
…to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write a function that…
Challenge
Sort launches by date with sorted() and a small function that returns each launch's date, then sort the cargo manifest heaviest first with a key function and reverse=True.
Challenge
Compare yesterday's and today's cargo IDs with set difference to print what was added and what was removed, then count what stayed with an intersection and print none for an empty change.
Challenge
…of dicts, one per item, with an ID, a name, a category and a mass. The loading crew wants it printed, one line per item, with the total at the bottom. Every item Print one manifest line for every…
Challenge
…it stores every reading as a dict with time, sensor, value and unit in a list of records, then let other code pick out one sensor's readings by key.
Challenge
Print the rocket's name and the first mission patch URL from a nested launch response by chaining keys and indexes, then add the operator and orbit and cope with a launch that has no patches yet.
Challenge
…by line with splitlines(), split each line at the commas and print the sensor and value, then unpack the four fields and show the clock time too.
Challenge
…dry_run is False, yet bool("False") turns it into True and the engine simulates instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings typed by hand.
Challenge
Read a console command with input(), accept start, stop and status in any case with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.
Challenge
…gives -004. Predict it, work out where indexes start and where a slice ends, fix it, then slice a sample label yourself.