title: How to properly use Variables in Python Functions?
body: <p>Building a random generator to determine the quality of gemstones. Running into a syntax error which is crashing the script... here's the code:</p>
  
  <pre><code>import random
  # Set the basic parameters of the gemstone to determine a description
  # and to determine the Gemstones base value.
  def gem_size():
      global gemsize
      gemsize random.randint(1,8)
  return gemsize
  def gem_shape():
      return random.randint(1,4)
  def gem_lustre():
      return random.randint(1,4)
  If gemsize == "8":
      GemSizeMult = 5 \
      GemDesc = Mammoth
  Elif gem_size == 7:
      GemSizeMult, GemDesc = 4, Giant
  </code></pre>
  
  <p>I want the function to simply generate a random number between one and eight and return that as the value for the variable <i>gem_size</i>. Where I'm getting the syntax error is when I try to compare the gem_size variable with one of the random numbers in order to set some additional gem description variables a bit later on. </p>
  
  <p>Can someone here provide a working example (that works) of how to set, assign, and compare a python variable using the random function?</p>