Calculate the sum of 2 answers This is the code for a calculator function. It takes the first and second number, combines them and asks for an input whether the calculation was correct. If the input is "Yes", a statement is printed. If the input is "No", a different statement is printed.

def calculator(number1,number2):
    answer = ['Yes', 'yes']
    print("The first number is %d." % number1,
          "The second number is %d." % number2)
    print("The sum is %d." % (number1 + number2))
    if input("Am I right? \nANSWER : ") in answer:
        print("Knew it!")
    else:
        print("Oh, well. Blame my programmer!")


Is there anything I can do to optimize the code and make it shorter and / or simpler?
Well, this program can be reduced a lot in pythonic way in terms of number for lines for sure!!

def calculator(number1,number2):
    try:
        print("The first number is {}\nThe second number is {}".format(number1, number2))
        print("The sum is {}".format(number1 + number2))
        print("Knew it!" if str(input("Am I right? \nANSWER : ")).lower() == "yes" else "Oh, well. Blame my programmer!")
    except Exception as e:
        print(e)


You have not taken care of handling input types, what if 2 different data types are passed?