it in loop--we get to bob' name immediately by indexing on key bob this really is dictionary of dictionariesthough you won' see all the gory details unless you display the database all at once (the python pprint pretty-printer module can help with legibility here)db {'bob'{'pay' 'job''dev''age' 'name''bob smith'}'sue'{'pay' 'job''hdw''age' 'name''sue jones'}import pprint pprint pprint(db{'bob'{'age' 'job''dev''name''bob smith''pay' }'sue'{'age' 'job''hdw''name''sue jones''pay' }if we still need to step through the database one record at timewe can now rely on dictionary iterators in recent python releasesa dictionary iterator produces one key in for loop each time through (for compatibility with earlier releaseswe can also call the db keys method explicitly in the for loop rather than saying just dbbut since python ' keys result is generatorthe effect is roughly the same)for key in dbprint(key'=>'db[key]['name']bob =bob smith sue =sue jones for key in dbprint(key'=>'db[key]['pay']bob = sue = to visit all recordseither index by key as you gofor key in dbprint(db[key]['name'split()[- ]db[key]['pay'* smith jones or step through the dictionary' values to access records directlyfor record in db values()print(record['pay'] [db[key]['name'for key in dbx ['bob smith''sue jones' [rec['name'for rec in db values()step representing records