title: 2d array structure python
body: <p>I am taking a python class and have no experience in python. The instructor only teaches documentation and refuses to give code examples. I understand C++ but I'm getting very frustrated with python because I am basically teaching myself.</p>
  
  <p>I want to open a text file that contains one string of random characters per line. The length could be 8, 10, 15, or 20 chars, for example. It has to be flexible. There can be an unspecified number of strings (lines) in the text file. </p>
  
  <p>The text file might look like this for example:</p>
  
  <pre><code>HGAMONIHRA
  AOMOKAWONS
  NFROLBOBDN
  ARFSIHCAGE
  LNIEEWONOK
  GOLFUNDTHC
  KOCATAOHBI
  AMRERCGANH
  SLGFAMALLC
  ALLIGATORX
  </code></pre>
  
  <p>I just want to figure out how to put each char in an array-like structure where I can access it like a 2d-array --> my array[2][3], for example. </p>
  
  <p>I was practicing with a dictionary just to test the behavior. I thought that I could use a dictionary with a nested for loop and then use a tuple as a key and pass a parsed char from the string as a value. I was thinking this might work but when I try to make a dictionary work with just a single line, my print statement only gives me one key and one value and not the list. I am really confused. I know this is a pain but will someone please teach me in simple terms? python is leaving a nasty taste in my mouth.</p>
  
  <p>This was my test code for just one line of a text file:</p>
  
  <pre><code>count = 0
  text = open("puzzle.txt")
  line = text.readline()
  for i in line:  #this is probably the problem
      mydict = dict()
      mydict.update({count:line[count-1]}) #was hoping to make many keys and values.
      count += 1
  
  print mydict.values() #want to see there are multiple dict values, each as a char.
  print count #just checking to see what count value was
  </code></pre>
  
  <p>Can someone teach me because my instructor will not and I really want to learn.</p>