title: invalid syntax error when using for loop on a zip object
body: <p>I'm learning how to optimize for loops in python 3.7, and I keep getting an "invalid syntax error". I've already checked for missing parenthesis. Here's the code:</p>
  
  <pre><code>    best = probabilities[0]
      best = (probabilities[i] for i in range(1, len(probabilities)) if probabilities[i] &gt; best)
      print(best)
      prob, im = (prob, im for prob, im in zip(probabilities, image_names) if prob == best)
  
      return (prob, im)
  </code></pre>
  
  <p>gives me the error </p>
  
  <pre><code>  File "path", line 27
      prob, im = (prob, im for prob, im in zip(probabilities, image_names) if prob == best)
                             ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I'm not sure what went wrong, as the following code I used in another exercise uses pretty much the same syntax:</p>
  
  <pre><code>im = [im for im, prob in zip(image_names, probabilities) if prob &gt;= threshold]
      return (im)
  </code></pre>
  
  <p>Edit:
  I've also tried </p>
  
  <pre><code>return (prob, im for prob, im in zip(probabilities, image_names) if prob == best)
  </code></pre>
  
  <p>and it says that the variable type is a Generator[tuple[float, str], Any, None] but I'm not sure what it means.</p>
  
  <p>Any help would be very appreciated</p>