def hour_to_24(hour, meridian):
    """
    Converts a 12-hour representation to a 24-hour representation.
    e.g.
        12, "AM" => 0
         6, "AM" => 6
        12, "PM" => 12
         3, "PM" => 15
        11, "PM" => 23
    """

    # first, if it's 12 whatever, subtract the 12 because it's actually 0
    if hour == 12:
        hour -= 12

    # if it's PM, add 12
    if meridian == "PM":
        hour += 12

    return hour