title: Why this syntax error in function conway's game of life in Python?
body: <p>I'm programming Conway's game of life in Python but stumbled upon a weird syntax error. It's in the first function i'm defining. It sais that nextnext in nextnext= [] in wrong. If i take that out the : after the for loop also gives a synthax error. I tried the function in a seperate file and it worked fine there so i really don't know what i'm doing wrong. </p>
  
  <pre><code>TIME = 100
  life = []           # create list 'life'
  life.append(seed)   # add seed to life
  
  numrows = len(seed)         # calculate number of rows
  numcolumns = len(seed[0])   # calculate number of columns
  current = seed              # make seed the first current(matrix you're starting off with in each step)
  nextnext = []
  
  def create_empty_universum (seed):
      numrows = len(seed)         # calculate number of rows
      numcolumns = len(seed[0]    # calculate number of columns
      nextnext = []               # create empty list next
      for i in range(numrows):    # define number of rows in nextnext
          nextnext.append([0] * numcolumns)  # define number of columns in nextnext
      return nextnext
  
  def compute_new_value(nextnext,row,column):    
      neighbors = 0                                 # start counter 'neighbors' with 0
      if current[row][(column+1)%numcolumns] == 1:  # if neighboring cell has a value of 1
          neighbors += 1                            # add 1 to neighbors
      if current[row][(column-1)%numcolumns] == 1:  # if neighboring cell has a value of 1        
          neighbors += 1                            # add 1 to neighbors      
      if current[(row-1)%numrows][column] == 1:     # if neighboring cell has a value of 1
          neighbors += 1                            # add 1 to neighbors      
      if current[(row+1)%numrows][column] == 1:     # if neighboring cell has a value of 1 
          neighbors +=1                             # add 1 to neighbors      
      if current[(row+1)%numrows][(column+1)%numcolumns] == 1:  # if neighboring cell has a value of 1
          neighbors +=1                                         # add 1 to neighbors 
      if current[(row-1)%numrows][(column+1)%numcolumns] == 1:  # if neighboring cell has a value of 1
          neighbors += 1                                        # add 1 to neighbors 
      if current[(row-1)%numrows][(column-1)%numcolumns] == 1:  # if neighboring cell has a value of 1
          neighbors += 1                                        # add 1 to neighbors 
      if current[(row+1)%numrows][(column-1)%numcolumns] == 1:  # if neighboring cell has a value of 1
          neighbors +=1                                         # add 1 to neighbors 
      if current[row][column] == 1:               # in case a target cell has a value of 1:
          if neighbors &lt; 2:                       # if the number of neighbors is smaller than 2
              nextnext[row][column] = 0           # value of target cell becomes 0 in nextnext
          elif neighbors == 2 or neighbors == 3:  # if the number of neighbors is 2 or 3
              nextnext[row][column] = 1           # value of target cell stays 1 in nextnext
          elif neighbors &gt; 3:                     # if the number of neigbors is higher than 3
              nextnext[row][column] = 0           # value of target cell becomes 0 in nextnext
      elif current [row][column] == 0:            # in case a target cell has a value of 0:
          if neighbors == 3:                      # if the number of neighbors is 3
              nextnext[row][column] = 1           # value of target cell becomes 1 in       nextnext
           elif neighbors != 3:                    # if the number of neigbors isn't 3
              nextnext[row][column] = 0           # value of target cell stays 0 in nextnext
      return nextnext
  
  for t in range(TIME):    # determine amount of times the loop will
      nextnext = create_empty_universum(seed)
      for row in range(numrows):              # for each
              for column in range(numcolumns):    # for each column 
  
                  nextnext = compute_new_value(nextnext,row,column)
  
  
  current = nextnext     # make nextnext matrix the current matrix for the next step 
  life.append(current)   # add current to life
  
  
  import show
  show.show(life, SIZE=10)
  </code></pre>