Home Code Of Simple Calculator Using Python byMYFILES-DOWNUP -August 19, 2021 Hi Guys Today I Will Show You How To Make Simple Calculator Using Python. Scroll Down And Copy The Code!! Enter Ad Link: #Program To Make Simple Calculator Using Functions # Define The Functions def add (x,y): """"This Function Adds 2 Numbers""" return x + y def substract (x,y): """"This Function Substracts 2 Numbers""" return x - y def multiply (x,y): """"This Function Multiplies 2 Numbers""" return x * y def devide (x,y): """"This Function Devide 2 Numbers""" return x / y def power (x,y): """"This Function Gives Power""" return pow (x,y) # take input from user print ('Select What you want to do.') print ('1.Add') print ('2.Substract') print ('3.Multiply') print ('4.Devide') print ('5.Power') choice=input('Enter choice 1/2/3/4/5:') num1=int(input('Enter the frist number: ')) num2=int(input('Enter the second number: ')) if choice == '1': print (num1, '+', num2, '=',add(num1,num2)) elif choice == '2': print (num1, '-', num2, '=',substract(num1,num2)) elif choice == '3': print (num1, '*', num2, '=',multiply(num1,num2)) elif choice == '4': print (num1, '/', num2, '=',devide(num1,num2)) elif choice == '5': print (num1, '^', num2, '=',power(num1,num2)) else: print ('invalid input') Copy! Facebook Twitter