title: How do I change variable to string in python
body: <p><em><strong>Here is a example code for my problem</strong></em></p>
  <pre><code>    import random 
  
  
      variable1 = &quot;lorem ipsum&quot;
      variable2 = &quot;lorem ipsum&quot;
      main = 0
      
      if variable1:
          main = &quot;&quot;.join(random.sample(variable1,variable2))
      
      
      print(main)
  </code></pre>
  <p>Then i get a error like this, I know what's the problem but I don't know how to fix it...</p>
  <pre><code>TypeError: '&lt;=' not supported between instances of 'int' and 'str'
  </code></pre>