Results for “key-value”

8 results

  1. Challenge

    Settings with defaults

    Build a user's settings by copying the defaults and laying their own values on top with update(), so any setting they haven't changed falls back, then warn about unknown keys instead of saving them.

    Write the code Medium 2 stages dictionaries copy update defaults
  2. Article Mini projects

    Calculate your weight on different planets in Python

    …a Dictionary? In Python, a dictionary is a collection of key-value pairs. It's like a real-world dictionary where you have a word (the key) and its definition (the value). In our program, we use a…

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