This program is suppose to generate two random numbers and have the user input the result. If the user input is correct, then the program will print 'You are correct!' If wrong, the program will print 'You are wrong!' However, when the user's answer is correct, the program still outputs "You are wrong!' Not sure why
import random
first = random.randint(0,9)
second = random.randint(0,9)
result = first + second
answer = input(str(first) + ' + ' + str(second) + ': ')
if result == answer:
print('You are correct!')
else:
print('Sorry you are wrong!')