title: Returning 'incorrect' regardless
body: <p>This has been flagged as a duplicate, i was unaware of the issue at the time but I shall take this post down in the next 48 hours, apologies. </p>
  
  <p>I'm currently working on a python <em>(v3.5.0:374f501f4567)</em> program that generates a ranom equation using multiplication, addition or subtraction using. The code works perfectly up until the final hurdle. When trying to return if the answer is correct or incorrect I am thoroughly stumped. When I use the following code:</p>
  
  <pre><code>import random
  from operator import add,sub,mul
  x=random.randint(0,10)
  y=random.randint(0,10)
  eqn=(add, sub, mul)
  eqnchoice=random.choice(eqn)
  eqnstring={add:'+',sub:'-',mul:'*'}
  useranswer=0
  def eqngenerator():
      random.seed
      answer=eqnchoice(x,y)
      answer=round(answer,2)
      print("what's the answer to",x,eqnstring[eqnchoice],y,"=?\n")
      useranswer=input("Enter the answer here:")
      if useranswer==answer:
          print('Correct!')
      else:
          print('Incorrect!')
  
  print(eqngenerator())
  </code></pre>
  
  <p>I am faced with the following problem as seen in the screenshots below.</p>
  
  <p><img src="https://i.stack.imgur.com/6rVnr.jpg" alt="the first image is an incorrect answer returning &#39;incorrect!&#39;"></p>
  
  <p><img src="https://i.stack.imgur.com/9m1yB.png" alt="The second image is a correct answer but, it is also returning &#39;incorrect!&#39;"></p>
  
  <p>I'm befuddled as to why this is, if anyone can help please do.
  Thank you for your time.</p>