Получить нужные значения из словаря



  • Подскажите как мне получить значения "discontinued" ?
    products = [
    {
    "discontinued": 0,
    "lead_time_days": 4,
    "product_category": "Toy",
    "product_description": "Pull out a bock without crashing the stack ...",
    "product_id": 101,
    "product_name": "Jenga Classic Game",
    "reorder_level": 50,
    "unit_price": 14.99
    },
    {
    "discontinued": 0,
    "lead_time_days": 4,
    "product_category": "Wireless Phone Accessory",
    "product_description": "Display: 2.5 inches Camera: 2 MP Talk Time: 4.5 hours Weight: 3.3 ounces",
    "product_id": 102,
    "product_name": "AT&T Z431 GoPhone (AT&T)",
    "reorder_level": 14,
    "unit_price": 49.99
    },
    {
    "discontinued": 1,
    "lead_time_days": 4,
    "product_category": "Wireless Phone Accessory",
    "product_description": "Display: 4.5-inches Camera: 5-MP Input: Touchscreen OS: Android",
    "product_id": 103,
    "product_name": "AT&T Z998 LTE Android Go Phone (AT&T Prepaid)",
    "reorder_level": 29,
    "unit_price": 159.99
    },
    {
    "discontinued": 1,
    "lead_time_days": 4,
    "product_category": "Personal Computers",
    "product_description": "8 inch Display (1920x1200) ...",
    "product_id": 104,
    "product_name": "NVIDIA SHIELD Tablet (WiFi)",
    "reorder_level": 10,
    "unit_price": 299.0
    }
    ]


  • Banned


Log in to reply