Results for “python dict”

Showing 41–50 of 58

  1. 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 .

    Write the code Hard 2 stages project scheduling lists tuples
  2. Article Mini projects

    Calculate your weight on different planets in Python

    …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…

  3. Article Mini projects

    Base 6 Number System in Python

    …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…

  4. Article Mini projects

    Calculating Escape Velocity in Python

    …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}…

  5. Article Python Fundamentals

    Python Books for Beginners

    …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…

  6. Article Python Fundamentals

    Variables and data types in Python

    …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"] }…

  7. Challenge

    Ground pass planner

    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…

    Write the code Medium 2 stages project datetime timedelta sorting
  8. Challenge

    Undo and history

    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.

    Write the code Hard 2 stages project lists stack append