def weather_emoji(code):
    """
    Accepts weather code integer.
    Returns emoji corresponding to OpenWeatherMap weather code.
    
    See https://openweathermap.org/weather-conditions
    Emojis differ from OpenWeatherMap icons.
    """
    first = int(code / 100)
    
    # thunderstorms
    if first == 2:
        return '\U0001F329'
    # shower rain
    elif first == 3 or 500 <= code <= 504:
        return '\U0001F327'
    # rain
    elif first == 5:
        return '\U0001F326'
    # snow
    elif first == 6:
        return '\u2744'
    # fog
    elif first == 7:
        return '\U0001F32B'
    # sun
    elif code == 800:
        return '\u2600'
    # few clouds
    elif code == 801:
        return '\u26C5'
    # clouds
    elif code >= 802:
        return '\u2601'
    # unrecognized code
    else:
        raise ValueError(f"Unrecognized weather ID: '{code}'.")