def temperature_closest_to_zero(temperatures):
    """Receives an array of temperatures and returns the closest one to zero"""

    closest_to_zero = temperatures[0]
    for temperature in temperatures:
        if (abs(temperature) < abs(closest_to_zero) or
                (abs(temperature) == abs(closest_to_zero) and temperature > 0)):
            closest_to_zero = temperature

    return closest_to_zero