Challenge
Shift rota
…6 Tanaka: 6 Okafor: 4 Bondarenko: 5 Keep the count in a dict, shifts_done , and the last person on duty in previous .
Showing 41–50 of 58
Challenge
…6 Tanaka: 6 Okafor: 4 Bondarenko: 5 Keep the count in a dict, shifts_done , and the last person on duty in previous .
Article Mini projects
…coding our space weight calculator: First, we'll create a dictionary of planets and their surface gravities: planets = { "Mercury": 3.7, "Venus": 8.87, "Earth": 9.81, "Mars": 3.711, "Jupiter": 24.79…
Example
Operator ** allows accepting any number of keyword arguments.
Challenge
…the output exactly the same, then put the waypoints in a dict and find the nearest one with the same function.
Article Mini projects
…we create the reverse mapping ( ERIDIAN_TO_DIGIT ) using a dictionary comprehension instead of typing it out manually. Less typing, fewer bugs. Putting It All Together: A Mini Converter Tool Here's a…
Article Mini projects
…here with vectorized operations: import numpy as np # Dictionary with planet data planets = { "Mercury": {"mass": 3.301e23, "radius": 2.4397e6}, "Venus": {"mass": 4.867e24, "radius": 6.0518e6}…
Article Python Fundamentals
…first half covers Python fundamentals (variables, lists, dictionaries, functions, classes), while the second half walks you through three complete projects - a Space Invaders-style game, data…
Article Python Fundamentals
…print(common_targets) Dictionaries Key-value pairs, perfect for storing related data: planet_data = { "name": "Mars", "diameter": 6779, # kilometers "has_moons": True, "moons": ["Phobos", "Deimos"] }…
Challenge
From today's passes over four ground stations, collect every contact window longer than 8 minutes into one list, sorted by time, then find the longest stretch with no station in contact, counting…
Challenge
Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.