title: Tiktok algo simulator
body: <p>I am making a TikTok algorithm and here is the code it essentially takes the input of the user and determines what rank they are.</p>
  <pre class="lang-py prettyprint-override"><code>import random
  
  share_count = int(input(&quot;How many shares did you get on your last tiktok &quot;))
  like_count = int(input(&quot;How many likes did you get on your last tiktok &quot;))
  comment_count = int(input(&quot;How many comments did you get on your last tiktok &quot;))
  posts = int(input(&quot;How many posts do you have on your tiktok page &quot;))
  
  def magic_algorithm(share_count, like_count, comment_count, posts):
      if share_count &gt;= 10000 and like_count &gt; 5000 and comment_count &gt; 200 and posts &gt;25:
          rank = 1 
      elif share_count &gt;= 7000 and like_count &gt; 2000 and comment_count &gt; 60 and posts &gt;25:
          rank = random.randint(2,10)
      elif share_count &gt;= 6000 and like_count &gt; 1500 and comment_count &gt; 50 and posts &gt;25:
          rank = random.randint(11,20)
      elif share_count &gt;= 5000 and like_count &gt; 1300 and comment_count &gt; 33 and posts &gt;20:
          rank = random.randint(21,40)
      elif share_count &gt;= 4000 and like_count &gt; 1000 and comment_count &gt; 25 and posts &gt;15:
          rank = random.randint(41,55)
      elif share_count &gt;= 3000 and like_count &gt; 500 and comment_count &gt; 15 and posts &gt;11:
          rank = random.randint(56,70)
      elif share_count &gt;= 2000 and like_count &gt; 300 and comment_count &gt; 10 and posts &gt;11:
          rank = random.randint(71,80)
      elif share_count &gt;= 1000 and like_count &gt; 150 and comment_count &gt; 10 and posts &gt;11:
          rank = random.randint(81,90)
      elif share_count &gt;= 400 and like_count &gt; 100 and comment_count &gt; 5 and posts &gt;11:
          rank = random.randint(91,95)
      else:
          rank = random.randint(96,100)
      return rank 
  print(&quot;you rank on the platform is &quot; + magic_algorithm(share_count, like_count, comment_count, posts)) 
  </code></pre>
  <p>but for some reason, I'm encountering an error that states:</p>
  <pre class="lang-py prettyprint-override"><code>print(&quot;you rank on the platform is &quot; + magic_algorithm(share_count, like_count, comment_count, posts))
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>TypeError: can only concatenate str (not &quot;int&quot;) to str
  </code></pre>