title: SyntaxError: cannot assign to operator
body: <pre><code>def RandomString (length,distribution):
      string = ""
      for t in distribution:
          ((t[1])/length) * t[1] += string
      return shuffle (string)
  </code></pre>
  
  <p>This returns a syntax error as described in the title. In this example, <code>distribution</code> is a list of tuples, with each tuple containing a letter, and its distribution, with all the distributions from the list adding up to 100, for example:</p>
  
  <pre><code>[("a",50),("b",20),("c",30)] 
  </code></pre>
  
  <p>And <code>length</code> is the length of the string that you want.</p>