- 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

18th Jan 2022, 4:20 PM
Yusuf Bello Garga
Yusuf Bello Garga - avatar
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..
18th Jan 2022, 4:47 PM
Jayakrishna 🇮🇳
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")
18th Jan 2022, 4:50 PM
Yusuf Bello Garga
Yusuf Bello Garga - avatar
0
Just use op = input( "Enter operator\n") Yusuf Bello Garga and input like 3 lines here : 2 + 3
18th Jan 2022, 4:51 PM
Jayakrishna 🇮🇳