Created
November 24, 2010 02:42
-
-
Save irskep/713006 to your computer and use it in GitHub Desktop.
Multidimensional arrays in Python: missing since before you were born
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def multidim_arr(*dims): | |
return [multidim_arr(*dims[1:]) for i in xrange(dims[0])] if dims else 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment