Challenge
Nested response
…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.
Showing 11–20 of 20
Challenge
…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.
Article Mini projects
…a random 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…
Example
Operator ** allows accepting any number of keyword arguments.
Example
Dictionaries store data as key-value pairs. Fast access to data by key.
Example
When to use tuples instead of lists? Comparison of properties and applications.
Challenge
…with csv.DictWriter : a header row with the four keys, then one row per subsystem. After the report, print an empty line, the saved line, and the file as it was written: Saved report.csv…
Challenge
…Write summarise(readings) , which returns a dict with the keys count , min , max and mean . Then print(summarise(pass_1)) prints: {'count': 5, 'min': 398.0, 'max': 455.2, 'mean': 419.5} Build the dict…
Quiz
…is not in a list IndexError and KeyError : positions and keys that do not exist ZeroDivisionError , and reading an error message to find the fix How it works 15 questions: 11 with one correct answer…
Article Mini projects
…WITH NUMPY") print("="*50) names = list(planets.keys()) masses = np.array([planets[p]["mass"] for p in names]) radii = np.array([planets[p]["radius"] for p in names]) # Calculate all escape velocities…
Article Mini projects
…In our program, we use a dictionary to store planets (keys) and their corresponding surface gravities (values). This allows us to quickly look up the gravity of any planet we've included. Dictionaries…