Faulty Calculator Program in PYTHON

Faulty Calculator Program in PYTHON


Design a Calculator which will Correctly solve all problems except the following ones :
1. 45*3 = 555       
2. 56+9 = 77           
3. 56/6 = 4


Source Code 


num1 = float(input("Enter First Operand -> "))
opr = input("Enter Operator -> ")
num2 = float(input("Enter Second Operand -> "))
if opr == "+":
    if num1 == 56 and num2 == 9:
        print("56 + 9 = 77")
    else:
        print(num1, '+', num2, '=', num1+num2)
elif opr == "*":
    if num1 == 45 and num2 == 3:
        print("45 * 3 = 555")
    else:
        print(num1, '*', num2, "=", num1*num2)
elif opr == "/":
    if num1 == 56 and num2 == 6:
        print("56 / 6 = 4")
    else:
        print(num1, '/', num2, '=', num1/num2)
elif opr == "-":
    print(num1, '-', num2, '=', num1-num2)
else :
    print("Plese enter valid Integer or operator! ")




Insta : @akashbroh
CodexPoint

Disqus Comments