number1 = float(input("Enter a number: "))
number2 = float(input("Enter a number: "))
operator = input("Enter the operator: ")
if operator == "+":
print("{} + {} = {}".format(number1, number2, (number1 + number2)))
elif operator == "-":
print("{} - {} = {}".format(number1, number2, (number1 - number2)))
elif operator == "*":
print("{} * {} = {}".format(number1, number2, (number1 * number2)))
else:
print("{} / {} = {}".format(number1, number2, (number1 / number2)))
I wrote my code in python 3. I hope this helps!