title: Strange SyntaxError: invalid syntax after defining statement in return
body: <p>I have read alot of strange syntaxerror questions and have not seen mine among it yet and I am really at a loss. I am doing some homework for which the deadline is coming closer and this error I cant get rid of:</p>
  
  <pre><code>def create_voting_dict():
      strlist = [voting_data[i].split() for i in range(len(voting_data))]
      return voting_dict = {strlist[h][0]:[int(strlist[h][g]) for g in range(3, len(strlist[h]))] for h in range(len(strlist))}
  </code></pre>
  
  <p>Which gets me the error:</p>
  
  <pre><code>return voting_dict = {strlist[h][0]:[int(strlist[h][g]) for g in range(3, len(strlist[h]))] for h in range(len(strlist))}
                                                                                          ^         
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>This error did not occur when I defined voting_dict inside the procedure, but I need to define it globally so i put it after return and then I got the error. Have been counting parenthesis all over but that doesnt seem to be the problem.</p>
  
  <p>I am sure that when I see the problem it is very easy, but I just dont see it. Thanks for any help.</p>
  
  <p>*voting data is a list with strings and I made the procedure to split the strings and create a dictionary</p>