ashish2py

Python List serialization

Sep 29th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. database = ["Crumbs","DotOrbit",["Google",[{'name':"guido van rossum","age":57}]]]
  2.  
  3. print database
  4. for each_item in database:
  5.     if  isinstance(each_item,list):
  6.         for child_item in each_item:
  7.             print child_item
  8.     else :
  9.         print each_item
  10.        
  11.        
  12.        
  13.        
  14.  
Advertisement
Add Comment
Please, Sign In to add comment