0
Is this not how it works?
There's an error in the or part apparently https://code.sololearn.com/cZN7L76EoEZ9/?ref=app
6 Answers
0
one thing I saw is that your input for the (strike:operand)â>operator is still a string but you arenât comparing to strings in your if statements
0
I'm trying to write a code for a simple calculator... doesnt using float before the input convert it?
0
are you making a calculator?
furthermore print(xzy) isnât going to do anything because you have declared an xzy variable
perhaps you meant print(x,z,y)
but this will not calculate anything, it will simply print numbers and an operator
0
ERROR_404 yes it does that, but not all types are created equal and you canât use all types the same. if you do
if z == â*â or z == â+â or etc:
then it will work
0
have you looked at the lesson in the Python course where it talks about making a simple calculator?
0
Hi.
Additionally to the points mentioned by Brave Tea you should be comparing the entered operation against string values, i.e. z == '+'