2

Possible Duplicate:
How to define Two-dimensional array in python

I have a variable that represents the number files in a file, n. I want to make a array whose size is 'n' x 'n'. Then I want to fill it with just 0's. Is an array the same as a list of lists? How do you make an array in Python, and how do you make it 'n' by 'b' big? This is probably a very novice question, but I'm new to stackoverflow.com.

Community
  • 1
  • 1
Naveen C.
  • 3,185
  • 5
  • 21
  • 12
  • 1
    Hi Naveen, welcome to StackOverflow! The next question is: Why do you need to create a (presumably uninitialized) 2D list beforehand at all? You don't usually have to do this in Python but create the list as you go along. A bit more info on what you're actually trying to do would be useful (you can edit your own post and add more information). – Tim Pietzcker Jul 27 '11 at 17:41
  • 2
    To the downvoters: This is not a question that warrants downvotes in my opinion. It's a perfectly legitimate question for a Python novice. +1 from me just for that. – Tim Pietzcker Jul 27 '11 at 17:42
  • Again: Please, explain your downvotes. People likes to learn something when asking SO. In the case of newcomers posts this should be an obliged policy imho – joaquin Jul 27 '11 at 17:48
  • @Tim I'm guessing they're due to this being a duplicate question. Since part of the downvote help text is "does not show any research effort" that could be considered an appropriate use. – thegrinner Jul 27 '11 at 17:51
  • Oh ok sorry I'll keep that in mind next time I post a question. – Naveen C. Jul 27 '11 at 17:58

0 Answers0