def lambda_handler(event):
    try:
        first_num = event["queryStringParameters"]["firstNum"]
    except KeyError:
        first_num = 0

    try:
        second_num = event["queryStringParameters"]["secondNum"]
    except KeyError:
        second_num = 0

    try:
        operation_type = event["queryStringParameters"]["operation"]
        if operation_type == "add":
            result = add(first_num, second_num)
        elif operation_type == "subtract":
            result = subtract(first_num, second_num)
        elif operation_type == "subtract":
            result = multiply(first_num, second_num)
        else:
            result = "No Operation"
    except KeyError:
        return "No Operation"

    return result


def add(first_num, second_num):

    result = int(first_num) + int(second_num)
    print("The result of % s + % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}


def subtract(first_num, second_num):

    result = int(first_num) - int(second_num)
    print("The result of % s - % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}


def multiply(first_num, second_num):

    result = int(first_num) * int(second_num)
    print("The result of % s * % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}

def lambda_handler(event):
    try:
        first_num = event["queryStringParameters"]["firstNum"]
    except KeyError:
        first_num = 0

    try:
        second_num = event["queryStringParameters"]["secondNum"]
    except KeyError:
        second_num = 0

    try:
        operation_type = event["queryStringParameters"]["operation"]
        if operation_type == "add":
            result = add(first_num, second_num)
        elif operation_type == "subtract":
            result = subtract(first_num, second_num)
        elif operation_type == "subtract":
            result = multiply(first_num, second_num)
        else:
            result = "No Operation"
    except KeyError:
        return "No Operation"

    return result


def add(first_num, second_num):

    result = int(first_num) + int(second_num)
    print("The result of % s + % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}


def subtract(first_num, second_num):

    result = int(first_num) - int(second_num)
    print("The result of % s - % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}


def multiply(first_num, second_num):

    result = int(first_num) * int(second_num)
    print("The result of % s * % s = %s" % (first_num, second_num, result))
    return {"body": result, "statusCode": 200}
