• Nearest Value

 

I keep getting a Type Error when I run this code, however it appears to run normally in the online IDE I'm using. Thoughts?

def nearest_value(values: set, one: int) -> int:
    a = [abs(one - value) for value in values]
    index_min = a.index(min(a))
    if one in values:
        return one
    else:
        return values[index_min]
.