Python addition math quiz
Question: Just learning python and I'm trying to make an extremely simple math quiz but
when running I get a syntax error please explain what I have done wrong

    
    
    from random import randint
    inf = 0
    while inf < 10:
        num1 = randint(0,5000)
        num2 = randint(0,5000)
        ans = num1+num2
        print(num1,"+",num2)
        plrans = input(int()"What's the answer?")
        if plrans = ans
            print("Correct!")
        else
            print("Incorrect :(")
    


Answer: There are a few things wrong here:

  1. The conversion to `int` should be done after getting the input from the user
  2. `=` is the assignment operator. In order to check for equality you should use the `==` operator
  3. Your `if` statement is missing a colon (`:`)
  4. So is your `else` statement:

  

    
    
    from random import randint
    inf = 0
    while inf < 10:
        num1 = randint(0,5000)
        num2 = randint(0,5000)
        ans = num1+num2
        print(num1,"+",num2)
        plrans = int(input("What's the answer?")) # issue 1
        if plrans == ans : # issues 2 and 3
            print("Correct!")
        else: # issue 4
            print("Incorrect :(")
    

