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)
0 Comments
Thanks for Supporting me