Made a faulty calculator!!!! Using Pycharm. It shows wrong ans for some targeted calculation [41*22, 62+4,62+4], whereas performs correct calculation for other all actions.

Here is my first python code. Feel free to use this code anywhere.
#This is the faulty calculator

num1 = int(input("Please input first number: "))
num2 = int(input("Please input second number: "))
ope1 = input("What would you like to perform: "
" + "
" - "
" / "
" * "
" % :")

if ope1 == "+":
ans = num1+num2
elif ope1 == "-":
ans = num1-num2
elif ope1 == "/":
ans = num1/num2
elif ope1 == "*":
ans = num1*num2

if ans == 41*22:
print("Your calculation is 99.")
elif ans == 62+4:
print("Your calculation is 74.")
elif ans == 50-43:
print("Your calculation is 2.")
else:
print("Your calculation is:", ans)

codeded by : BKlp.
instagram : bee_kalpa_

Comments

Popular posts from this blog