bob = {'name':'Bob Smith','age':42,'pay':30000,'job':'dev'} sue = {'name':'Sue Jones','age':45,'pay':40000,'job':'hdw'} tom = {'name':'Tom','age':50,'pay':0,'job':'none'} db = {} db['bob'] = bob db['sue'] = sue db['tom'] = tom if __name__ == '__main__': for key in db: print (key, '=>\n ', db[key])
转载于:https://www.cnblogs.com/wuzhenyang/p/6675725.html