Faulty calculator
a=int(input("Enter first number"))
c=input("Enter operator")
b=int(input("Enter second number"))
if a==45 and b==3 and c=='*':
print("Your answer is", 555)
elif a==56 and b==9 and c=='+':
print("Your answer is", 77)
elif a==56 and b==6 and c=='/':
print("Your answer is", 4)
elif c=='+':
print("Your answer is", a+b)
elif c=='-':
print("Your answer is", a-b)
elif c=='*':
print("Your answer is",a*b)
else :
print("Your answer is ",a/b)
Comments
Post a Comment