def main(): while True: func_str = input("please enter formula\n") #if func_str=="exit"or"e": # break c = cal.calculator() print("The Answer is :", c.calculate(func_str))
def cal(device, state, hours, days): print("Visited Calculator URL Page") print("------------------------------") device = device state = state hours = float(hours) days = int(days) y = calculator(device, state, hours, days) return jsonify(y)
def cal_output(): print("Visited Calculator Output Page") print("------------------------------") device = request.form["device"] state = request.form["state"] hours = float(request.form["hours"]) days = int(request.form["days"]) x = {"device": device, "state": state, "hours": hours, "days": days} y = calculator(device, state, hours, days) return {"inputs": x, "outputs": y}
def main(): while True: func_str = input("please enter formula\n") c = cal.calculator() print("The Answer is :", c.calculate(func_str))
def main(): while True: func_str = input("please enter formula\n") c = cal.calculator() c.calculate(func_str)
from cal import calculator cal1 = calculator([1, 2, 3, 4, 5]) cal1.sum()