title: IndexError: list assignment index out of range Python 3
body: <p>Someone has a Idea why i get an IndexError in this code?</p>
  
  <pre><code>            global gegner
              global gegnerhp
              gegner = []
              gegberhp = []
  
  
  
              for i in range(1,anzahlgegner):
                  random = randint(1,5)
                  if random == 1:
                      gegner[i] = "goblin"
                      gegnerhp[i] = randint(10,50)
                  elif random == 2:
                      gegner[i] = "ghost"
                      gegnerhp[i] = randint(10,50)
                  elif random == 3:
                      gegner[i] = "hound"
                      gegnerhp[i] = randint(10,50)
                  elif random == 4:
                      gegner[i] = "wolf"                        #LINE 147
                      gegnerhp[i] = randint(10,50)
                  elif random == 5:
                      gegner[i] = "goblin"
                      gegnerhp[i] = randint(10, 50)
                  print("* {0} with {1} HP".format(gegner[i]),gegnerhp[i])
  </code></pre>
  
  <p>For example when random is 4 i get the following error:</p>
  
  <pre><code>  File "C:/Users/Fabio/PycharmProjects/test\dungeon.py", line 147, in run
  gegner[i] = "wolf"
    IndexError: list assignment index out of range
  </code></pre>
  
  <p>Maybe my declaration of the list/arrays is wrong?...</p>