Answers for "how to nested dictonary that condition"

2

python create nested dictionary

nested_dict = { 'dictA': {'key_1': 'value_1'},
                'dictB': {'key_2': 'value_2'}}
Posted by: Guest on January-03-2020
0

how to nested dictonary that condition

people = {1: {'name': 'John', 'age': '27', 'sex': 'Male'},
          2: {'name': 'Marie', 'age': '22', 'sex': 'Female'}}

people[3] = {}

people[1]['name'] = 'Luna'
people[1]['age'] = '24'
people[1]['sex'] = 'Female'
people[1]['married'] = 'No'

print(people[1])
Posted by: Guest on January-06-2021
-1

Nested dictionary Python

D = {'emp1': {'name': 'Bob', 'job': 'Mgr'},
     'emp2': {'name': 'Kim', 'job': 'Dev'},
     'emp3': {'name': 'Sam', 'job': 'Dev'}}
Posted by: Guest on November-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language