Challenge
Shift rota
…the rota, and check its own work. In turn Build rota , a list of (day, shift, name) tuples for every shift of the week, in order, taking the crew in turn. Print one line per day, then count how many…
Showing 11–20 of 35
Challenge
…the rota, and check its own work. In turn Build rota , a list of (day, shift, name) tuples for every shift of the week, in order, taking the crew in turn. Print one line per day, then count how many…
Quiz
Free beginner quiz on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Challenge
…which returns the count, min, max and mean of a list of readings as one dict, then make it handle a pass with no data and round the mean, so any program can use the summary.
Challenge
Build a dict that maps every cargo ID to its record, so any item is found with one lookup instead of a search through the list, then answer a list of requests, including an ID that isn't on the…
Challenge
Add up the cargo mass of each category into a dict with totals[category] = totals.get(category, 0) + mass, then list the categories from heaviest to lightest with their share of the load.
Challenge
Write problems(item), which lists everything wrong with one cargo item: missing fields, a mass that isn't a number, is 0 or is over the limit. Print a pass or fail line per item, then catch duplicate…
Challenge
Print the name, provider and status of a launch from a dict shaped like a launch-API response, then list every field the response has with items(), the way you'd inspect an API you haven't used…
Challenge
…that fills in what is missing, checks what is there, and lists every problem before anything starts. Defaults first Load settings_text with json.loads() . Start config as a copy of DEFAULTS , fill in…
Quiz
…20 multiple-choice questions on print(), strings, lists, dictionaries, loops and functions, with instant answers.
Challenge
…launches in whatever order it likes, and the warehouse lists cargo in the order it was packed. The launch board needs dates in order, and the loading crew wants the heaviest items first, because they…