- 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
3 ответов
0
Its specified there in comments how to debug..
/* - Enter 2 numbers like 1+2
-you can only use these arithmetic operations
+
-
*
/
- you can use decimal values
*/
Try input like ex:
2+3
But it's a C program.
Not python..
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\n")
Yusuf Bello Garga
and input like 3 lines here :
2
+
3