Challenge
Sign-up cleanup
…two weeks in a sealed habitat, has closed, and the list is a mess: names in capitals or with double spaces, emails with stray spaces, people who signed up twice, an entry with no name at all. Clean it…
Showing 61–70 of 92
Challenge
…two weeks in a sealed habitat, has closed, and the list is a mess: names in capitals or with double spaces, emails with stray spaces, people who signed up twice, an entry with no name at all. Clean it…
Article Mini projects
…def load_astronauts(self): pass # We'll reload astronauts list here def view_astronauts(self): pass # We'll view a list of astronauts list here def setup_medical_tab(self): pass # We'll add medical…
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…
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…
Quiz
…keys() , values() and items() Counting with a dictionary, lists inside dictionaries and nested dictionaries How it works 15 questions: 11 with one correct answer, 4 where you select every correct…
Challenge
…C line.split(",") cuts the text at every comma and gives a list of the pieces. You pick a piece by its index, the same way as a character in a string: fields[0] is the first. Lists get a stage of…
Article Python Fundamentals
…evaluates the value directly: payloads_ready = [] # empty list is falsy if payloads_ready: print("Start deployment.") else: print("No payloads — skip deployment.") Empty lists, empty strings, zero…
Challenge
…with 12 slots each. The loading crew needs a packing list: how many crates, and how full the last one is. Start with the crates the tubes fill completely, then work out the full packing list. Full…
Challenge
…for Scrub, and grey for any other status. The board now lists TBD too, and must print: Go: green Hold: amber Scrub: red TBD: grey Make: Battery state Write battery_state(percent) : full from 80% up…
Quiz
…leaving a function early Local and outside variables, and lists passed into a function Docstrings, calling one function inside another and passing a function as a value How it works 15 questions: 11…