what i did this friday

what i did this friday is make a calculator and learn how to do this myself

print("Choose an operation:")
print("1 - Add")
print("2 - Subtract")
print("3 - Multiply")
print("4 - Divide")
option = int(input("choose an operation"))

if(option in [1,2,3,4]):
    num1 = int(input("Enter first number: "))
    num2 = int(input("Enter first number: "))

    if(option == 1):
        result = num1 + num2
    elif(option ==2):
        result = num1 - num2
    elif(option ==3):
        result = num1 * num2
    elif(option ==4):
        result = num1 // num2



else:
    print("Invalid opertion enter")

print("The result of the operation is {}".format(result))

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *