Calculator
print(" MY CALCULATOR ")
print("enter 1st value")
val1=int(input())
print("enter 2nd value")
val2=int(input())
print("enter the operation to be performed 1->+ ,2->-, 3->/, 4->*")
opp=int(input())
if val1==56 and val2==9 and opp==1:
print("Answer is= 77")
elif val1==45 and val2==2 and opp==4:
print("Answer is= 555")
elif val1==56 and val2==6 and opp==3:
print("Answer is= 555")
elif opp==1:
ans=int(val1)+int(val2)
print(ans)
elif opp==2:
ans=int(val1)-int(val2)
print(ans)
elif opp==3:
ans=int(val1)*int(val2)
print(ans)
elif opp==4:
ans=int(val1)/int(val2)
print(ans)
Comments
Post a Comment