Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to access a dictionary within a dictionary in python

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

print(people[1]['name'])
print(people[1]['age'])
print(people[1]['sex'])
Comment

PREVIOUS NEXT
Code Example
Python :: pandas df.index.values 
Python :: python - gropuby based on 2 variabels 
Python :: python or 
Python :: sum values in django models and insert value in model field 
Python :: how to add trailing zeros in python 
Python :: how to run python in atom 
Python :: Get the first 4 numbers of the innermost arrays using numpy 
Python :: pytorch studiogan 
Python :: python calculations with variable x (letter) 
Python :: how to make code to do something for curtain number of seconds python 
Python :: Python Print Variable Using the string formatting with positional arguments {} 
Python :: python data types 
Python :: telegram.ext 
Python :: subplot ytick percent 
Python :: How To Let Your Main Window Appear after succesful login in Tkinter 
Python :: Get percentage of missing values pyspark all columns 
Python :: python mouse listener 
Python :: Using emoji Modules in Python 
Python :: snakeviz python profile 
Python :: use rectangular signal in python 
Python :: python manual elif 
Python :: why python stops after plt.show() 
Python :: CMake Error at pybind11/tools/FindPythonLibsNew.cmake:131 (message): Python config failure: 
Python :: /n python 
Python :: stack widgets in tkinter 
Python :: python sum certain postions of array 
Python :: object function in python 
Python :: unique file name in django 
Python :: python meanGroups(a): 
Python :: get every second elemnt of array matlab 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =