Python Calculator Use In All Operations | Advance Calculator Using Python



in this video explain how to create a Python Calculator Use In All Operations | Advance Calculator Using Python -

Python Calculator Project Code Here:

import random
def add(num1,num2):
    result=num1+num2
    print(num1,"+",num2 , "=" ,result)

def sub(num1,num2):
    result=num1-num2
    print(num1,"-",num2 , "=" ,result)
def mult(num1,num2):
    result=num1*num2
    print(num1,"*",num2 , "=" ,result)
def div(num1,num2):
    result=num1/num2
    print(num1,"/",num2 , "=" ,result)

choice = input("Enter operator : +,-,*,/ :  ")
firstnum=int(input("Enter your first number : "))
secondnum = int(input("Enter your 2nd number : "))

if choice =="+":
  add(firstnum, secondnum)
if choice =="-":
  sub(firstnum, secondnum)
if choice =="*":
  mult(firstnum, secondnum)
if choice =="/":
  div(firstnum, secondnum)
 

___/ Social Links /____ 🔁 Facebook:
https://www.facebook.com/mscubetechco... 🛑 YouTube : https://www.youtube.com/channel/UC1Gb..
.


Post a Comment

0 Comments

Close Menu