'if (input == operator): not working in python calculator?
print ("THE CALCULATOR")
print ("Type 1st no")
n = input()
print("Type 2nd no")
n2 = input()
print("Which Operator?")
n3 = input()
if (n3 == +):
print("The anwser is", int(n) + int(n2))
Solution 1:[1]
Change:-
if (n3 == +):
To:-
if (n3 == '+'):
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
