➤ Using if ,elif and else condition to making calculator : num1=int(input("Enter the first number : ")) opr=input("Enter the operation to be operate..('+ - * /) : ") num2=int(input("Enter the number : ")) if( opr==" + "): print(num1+num2) elif( opr==" * "): print(num1*num2) elif(opr==" - "): print(num1 - num2) elif(opr==" / "): print(num1/num2) else: print("Invalid choice") OUTPUT : Enter the first number : 12 Enter the operation to be operate..('+ - * /) : * Enter the number : 2 24 Enter the first number : 8 Enter the operation to be operate..('+ - * /) : - Enter the number : 4 4 Enter the first number : 12 Enter the operation to be operate..('+ - * /): / Enter the number : 4 3 ➤ Using if ,elif and else condition to making calculator : print(''' + ADD - SUBTRACT * MULTIPLY / DIVIDE ''') num1=int(input("Enter the value1:- ")) num2=int(input("Enter the value2:- ")) opr=input("Enter the opr..(+ , -, *, /)") if opr=="+": print(num1+num2) elif opr=="-": print(num1-num2) elif opr=="*": print(num1*num2) elif opr=="/": print(num1/num2) else: print("invalid choice") OUTPUT : + ADD - SUBTRACT * MULTIPLY / DIVIDE Enter the value1:- 12 Enter the value2:- 4 Enter the opr..(+,-,*,/)+ 16 # adding (12+4)
Calculator making by using Python programming
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated