def humidex_degree_of_comfort(humidex):
    """Get the degree of comfort associated with a given Humidex value.

    Degrees of comfort are provided by the Government of Canada and are indicated
    here with the following integer values:

    * 0 = No discomfort (Humidex of 19 and below)
    * 1 = Little discomfort (Humidex between 20 - 29)
    * 2 = Some discomfort (Humidex between 30 - 39)
    * 3 = Great discomfort; avoid exertion (Humidex between 40 - 45)
    * 4 = Dangerous; heat stroke possible (Humidex of 45 and above)

    See: https://www.canada.ca/en/environment-climate-change/services/seasonal-weather-hazards/warm-season-weather-hazards.html#toc7

    Args:
        humidex: Humidex

    Returns:
        int -- Degree of Comfort
    """
    if humidex < 20.0:
        return 0
    elif 20.0 <= humidex < 30.0:
        return 1
    elif 30.0 <= humidex < 40.0:
        return 2
    elif 40.0 <= humidex < 46.0:
        return 3
    return 4
