def operation(): num1 = int(input("Please provide a number: ")) operand = str(input("Please provide a math operator\nex: +, -, *, /\n : ")) num2 = int(input("Please provide another number: ")) if operand == "+": print(math.add(num1, num2)) elif operand == "-": print(math.subtract(num1, num2)) elif operand == "*": print(math.multiply(num1, num2)) elif operand == "/": print(math.divide(num1, num2)) again = str(input("Again? Y/N :")) if again.lower() == "y" or again.lower() == "yes": operation() else: exit()
import math_module print(math_module.add(23, 35)) print(math_module.add(*list(range(0, 11)))) print(math_module.div(3, 0)) print(math_module.div(33, 10))
import math_module print("\n 1.Addition \n2.substraction \n 3.MUltiplication \n 4.Division") a = input("Enter first number::") b = input("Enter second number::") ch = input("Enter your choice ") if (ch == 1): math_module.add(a, b) elif (ch == 2): math_module.sub(a, b) elif (ch == 3): math_module.mul(a, b) elif (ch == 4): math_module.div(a, b) else: print("Enter correct choice:::")
import math_module as m # print print("+++", m.add(1, 2)) # no print m.sub(2, 3) # print m.show(m.sub(10, 3))
#%load Module_2.py import Module_2 tax_for_this_order = Module_2.calc_tax(sales_total=102123.37, tax_rate=.05) print(tax_for_this_order) import math_module as m print(m.add(6, 9)) import math_module x = math_module.add(7, 9) print(x)