Q:

Problems with python math

I'm creating program which will teach my little brother math. But for example, when program is saying 2 + 2, and I enter 4 it's saying "Incorrect!". What am I doing wrong?
import random
import math

def addition():
    num1 = random.randint(1, 100)
    num2 = random.randint(1, 100)
    result = num1 + num2
    guess = input(str(num1) + " + " + str(num2) + " = ")#this is the line with problem
    if guess == result:
        print("Correct!")
    if guess != result:
        print("Incorrect!")
addition()

A:

result is an integer (e.g., 4), and the inputed guess is a string (e.g., '4'). You need to convert them to the same type in order to compare them. E.g.:
result = str(num1 + num2)

