Challenge
Confirm by name
…is passed by name: a bare * makes confirm keyword-only and required, then an is True check refuses values that are merely truthy, such as "yes".
Showing 61–70 of 233
Challenge
…is passed by name: a bare * makes confirm keyword-only and required, then an is True check refuses values that are merely truthy, such as "yes".
Challenge
…output exactly the same, then put the waypoints in a dict and find the nearest one with the same function.
Challenge
…record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
…another conversion that the crew displays can use. Predict and run Don't run the code yet. Read it and decide what it will print on its last line. Write your guess in prediction , at the top, between…
Challenge
…of everything wrong with a cargo record: missing fields and a negative mass, then a cargo ID that doesn't match the CG- and four digits format. An empty list means the record is fine.
Challenge
…yet. Predict it, check the keys with in, fix it with get() and a default, then print a list of launches with defaults for any missing field.
Challenge
…a list of strings with a loop inside a loop, print the row and column of every # with enumerate(), then turn the loops around to find the columns that are clear all the way through.
Challenge
Go through the mission log and build a new list holding only the WARN and ERROR entries with append(), then let a minimum level decide what counts, the way logging tools filter by severity.
Challenge
…first ERROR entry, print its line number with enumerate() and stop there with break, then report how many lines were checked, or that there were no errors at all.
Challenge
Summarise a list of engine readings with min(), max() and a mean from sum() / len(), then add the spread and make the summary cope with an empty list instead of crashing.