#NEWLINE# def closest( number , neighbors ) : #NEWLINE# #INDENT# distance = None #NEWLINE# closestNeighbor = None #NEWLINE# for neighbor in neighbors : #NEWLINE# #INDENT# d = abs ( ( neighbor - number ) ) #NEWLINE# if ( ( distance is None ) or ( d < distance ) ) : #NEWLINE# #INDENT# distance = d #NEWLINE# closestNeighbor = neighbor #NEWLINE# #UNINDENT# #UNINDENT# return closestNeighbor