- 1
Please can anyone assist to debug this program for me?
Its just a simple calculator using if statement in Python https://code.sololearn.com/csq1bt959x9H/?ref=app
7 Respostas
+ 1
I cant able to run it, whats the bug in tge program
+ 1
I ran it several times without a problem. Are you running the code in code playground or somewhere else? If you can't run, there is surely an error message - which is it?
+ 1
See my 2nd question
0
First, pls post your question only once!
I found nothing wrong. What's your question?
0
num1 = float(input("First Number:"))
op = float(input("Enter operand"))
num2 = float(input("Enter Second Number"))
if op == "+":
print(num1 + num2 )
elif op == "*":
print(num1 * num2 )
elif op == "-":
print(num1 - num2 )
elif op == "/":
print(num1 / num2 )
else:
print("invalid operator")
0
Just use
op = input("Enter operator")
0
In a play background and on a pycharm