title: How to have a percentage chance of a command to run
body: <p>I have 10 things that I want to be printed if they are picked. However each should have a different percentage chance of happening though. </p>
  
  <p>I tried doing the following:</p>
  
  <pre><code>    chance = (random.randint(1,100))
      if chance &lt; 20:
          print ("20% chance of getting this")
  </code></pre>
  
  <p>The problem is that if I do another one with say, chance &lt;25, if the randint is 10, wouldn't both the chance &lt;25 and chance &lt;20 both run at the same time?</p>
  
  <p>Here is the code I want to have the chance stuff going on after.</p>
  
  <pre><code>print ("You selected Grand Theft Auto")
  gta = input ("To commit GTA input GTA")
  if gta in ("gta", "Gta", "GTA"):
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Alright so I tried this but it keeps giving 3 outputs.</p>
  
  <pre><code>print ("You selected Grand Thief Auto")
      gta = input ("To commit GTA type GTA")
      if gta in ("gta", "Gta", "GTA"):
          chance = random.randint(0,100)
          if chance &lt;= 1:
              print ("You stole a Bugatti Veryron")
          chance = random.randint(0,100)
          if chance &lt;= 5:
              print ("You stole a Ferrari Spider")
          chance = random.randint(0,100)
          if chance &lt;= 10:
              print ("You stole a Audi Q7")
          chance = random.randint(0,100)
          if chance &lt;= 15:
              print ("You stole a BMW X6")
          chance = random.randint(0,100)
          if chance &lt;= 20:
              print ("You stole a Jaguar X Type")
          chance = random.randint(0,100)
          if chance &lt;= 25:
              print ("You stole a Ford Mondeo")
          chance = random.randint(0,100)
          if chance &lt;= 30:
              print ("You stole a Audi A3")
          chance = random.randint(0,100)
          if chance &lt;= 35:
              print ("You stole a Ford Fiesta")
          chance = random.randint(0,100)
          if chance &lt;= 40:
              print ("You stole a Skoda Octavia")
          chance = random.randint(0,100)
          if chance &lt;= 45:
              print ("You got caught!")
  </code></pre>