def length(): try: result = "" input = str(request.args.get('evalstring')) result = len(input) savequery(input, result) except: result = "Error" return jsonify(result)
def reverse(): try: result = "" input = str(request.args.get('evalstring')) for i in input: result = i + result savequery(input, result) except: result = "Error" return jsonify(result)
def concatenate(): try: result = "" query = str(request.args.get('evalstring')) input = str(request.args.get('evalstring')) input = input.split("+") for x in range(len(input)): result += input[x] savequery(query, result) except: result = "Error" return jsonify(result)
def calculate(): try: input = request.args.get('evalstring') print(input) result = eval(input) print(result) savequery(input, result) temp = result + 1 except TypeError: result = "Error" except NameError: result = "Error" # except : # result = "Error" return jsonify(result)