... try: prvni = int(request.form["prvni"]) druhe = int(request.form["druhe"]) except ValueError: abort(400) operace = request.form["operace"] ...