Advertisement
here2share

# list_array_gen.py

May 19th, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. # list_array_gen.py
  2.  
  3. myList=[[[] for i in range(3)] for i in range(5)]
  4. print myList
  5. myList[3][1].append('#')
  6. print myList
  7. myList[3][1].append(123)
  8. print myList
  9.  
  10. # ...or even...
  11. myList=eval(str([[[]]*3]*5))
  12. print myList
  13. myList[3][1].append('abc')
  14. print myList
  15. myList[3][1].append(9)
  16. print myList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement