Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <divad> jesyspa: we were wondering yesterday, what would be the best way to make a copy of a multidimensional list? (besides importing some module that provides a "matrix" data type)
- <jesyspa> As in, deep-copy two levels?
- <divad> yes
- <jesyspa> [x[:] for x in li]
- <divad> aaaaaahh
- <divad> nice :-)
- <divad> thx
- <jesyspa> (to be honest though, I tend to be suspicious of two-dimensional lists, and outright afraid of anything deeper than that. :P)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement