Quiz
Python Dictionaries Quiz
…on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Showing 11–20 of 57
Quiz
…on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Article Mini projects
…custom parameters") print(" 0. Exit") print("-"*50) def get_custom_parameters(): """Gets parameters from user.""" print("\nENTER CELESTIAL BODY DATA") name = input("Name: ") while True: try: mass_str…
Challenge
…3. Arm the abort system 4. Switch to internal power 5. Get a go from Mission Control enumerate(checklist, start=1) gives pairs of a number and an item. Unpack them in the loop: for number, item in…
Challenge
…timestamp with datetime.fromisoformat(), subtract them to get the mission elapsed time, then time events reported by ground stations in three different time zones.
Challenge
…then add checks that a log passed in is still the one that gets the sample, so a "fix" that breaks that can't pass either.
Challenge
…the planet, the receiver waits for the antenna signal to get strong enough to lock on. The waiting code should print a line each second and then report the lock. Instead, the ground station screen…
Article Mini projects
…planet destination = random.choice(list(planets.keys())) # Get planet details planet_info = planets[destination] return destination, planet_info # Let's try our space lottery! planet, details =…
Challenge
…ID. Answer each one from the index; an ID that isn't in it gets a message instead of a KeyError : CG-0044 | Freeze-dried meals | food | 42.0 kg CG-0099: not on the manifest CG-0042 | Water filter…
Challenge
…prints its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that returns.
Example
Dictionaries can contain other dictionaries. Useful for complex data structures.