Seach

Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

simple dictionary nesting example

person={
   1:{
      "age":20,
      "gender":"645654"
   },2:{
      "age":30,
      "gender":"344445455"
   },3:{
      "age":60
   }
} creates a list name called person

for value in person:
    print(person.get(value).get("age"))
#get() used to get the value of the list based on key