title: How to fix an unsupported operand type(s) for *: 'function' and 'float' error
body: <p>I am trying to calculate the limiting reagent but I am recieving this error once it get to that part of the calculations at the line:</p>
  
  <pre><code>gramOxygenAA = (moleOxygen * (2/1)) * ((12.011*2) + (1.008*4) + (15.9994 * 2))
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code># Function that determines moles of oxygen input
  def moleOxygen (gramOxygen):
      moleOxygen = gramOxygen / (15.9994 * 2)
      print ("Moles of oxygen available:", format(moleOxygen,'.2f'))
      return (moleOxygen)
  
  
  # Function that determines moles of acetaldehyde input
  def moleAcetaldehyde (gramAcetaldehyde):
      moleAcetaldehyde = gramAcetaldehyde / ((12.011*2) + (1.008*4) + 15.999)
      print ("Moles of acetaldehyde available:", format(moleAcetaldehyde,'.2f'))
      return moleAcetaldehyde
  
  
  # Function that determines grams of Acetic Acid produced from available oxygen
  def gramOxygenAA (moleOxygen): 
      gramOxygenAA = (moleOxygen * (2/1)) * ((12.011*2) + (1.008*4) + (15.9994 * 2))
      print ("Grams of Acetic Acid that can be produced from available oxygen is", format(gramOxygenAA,'.2f'))
      return gramOxygenAA
  
  
  # Function that determines grams of Acetic Acid produced from available acetaldehyde
  def gramAcetaldehydeAA ():
      gramAcetaldehydeAA = (moleAcetaldehyde / (2/2)) *((12.011*2) + (1.008*4) + (15.9994 * 2))
      print ("Grams of Acetic Acid that can be produced from available acetaldehyde is", format(gramAcetaldehydeAA, '.2f'))
      return gramAcetaldehydeAA
  
  
  # Function that determines the Limiting Reagent
  def limitingReagent():
      if gramOxygenAA &lt; gramAcetaldehydeAA:
          smaller = gramOxygenAA
          print ("Oxygen is the limiting reagent")
  
      else:
          smaller = gramAcetaldehydeAA
          print ("Acetaldehyde is the limiting reagent")
  
      return smaller
  
  
  def main ():
      gramOxygen = float (input("Enter grams of oxygen entered into the reaction: "))
      gramAcetaldehyde = float (input("Enter grams of acetaldehyde entered into the reaction: "))
  
      print ("*" * 80)
  
      moleOxygen (gramOxygen)
      moleAcetaldehyde (gramAcetaldehyde)
      gramOxygenAA (moleOxygen)
      gramAcetaldehydeAA ()
  
      limitingReagent()
      print ("The number of grams of acetic acid produced due to limiting reagent is", format (smaller,'.2f'))
  
  
  ### Call to main program ###
  main ()
  </code></pre>
  
  <p>My edited changed code:</p>
  
  <pre><code># Function that determines moles of oxygen input
  def moleOxygen (gramOxygen):
      molesOxygen = gramOxygen / (15.9994 * 2)
      print ("Moles of oxygen available:", format(molesOxygen,'.2f'))
      return (molesOxygen)
  
  
  # Function that determines moles of acetaldehyde input
  def moleAcetaldehyde (gramAcetaldehyde):
      molesAcetaldehyde = gramAcetaldehyde / ((12.011*2) + (1.008*4) + 15.999)
      print ("Moles of acetaldehyde available:", format(molesAcetaldehyde,'.2f'))
      return molesAcetaldehyde
  
  
  # Function that determines grams of Acetic Acid produced from available oxygen
  def gramOxygenAA (): 
      gramsOxygen = (moleOxygen * (2/1)) * ((12.011*2) + (1.008*4) + (15.9994 * 2))
      print ("Grams of Acetic Acid that can be produced from available oxygen is", format(gramsOxygenAA,'.2f'))
      return gramsOxygen
  
  
  # Function that determines grams of Acetic Acid produced from available acetaldehyde
  def gramAcetaldehydeAA ():
      gramsAcetaldehydeAA = (molesAcetaldehyde / (2/2)) *((12.011*2) + (1.008*4) + (15.9994 * 2))
      print ("Grams of Acetic Acid that can be produced from available acetaldehyde is", format(gramsAcetaldehydeAA, '.2f'))
      return gramsAcetaldehydeAA
  
  
  # Function that determines the Limiting Reagent
  def limitingReagent():
      if gramsOxygen &lt; gramsAcetaldehydeAA:
          smaller = gramsOxygen
          print ("Oxygen is the limiting reagent")
  
      else:
          smaller = gramsAcetaldehydeAA
          print ("Acetaldehyde is the limiting reagent")
  
      return smaller
  
  
  def main ():
      gramOxygen = float (input("Enter grams of oxygen entered into the reaction: "))
      gramAcetaldehyde = float (input("Enter grams of acetaldehyde entered into the reaction: "))
  
      print ("*" * 80)
  
      moleOxygen (gramOxygen)
      moleAcetaldehyde (gramAcetaldehyde)
      gramOxygenAA ()
      gramAcetaldehydeAA ()
  
      limitingReagent()
      print ("The number of grams of acetic acid produced due to limiting reagent is", format (smaller,'.2f'))
  
  
  ### Call to main program ###
  main ()
  </code></pre>
  
  <p>But I still get the same error... so sad...</p>