#NEWLINE# def median( iterable ) : #NEWLINE# #INDENT# if ( not iterable ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# sorted_list = sorted ( iterable ) #NEWLINE# if ( ( len ( right_median ) % 2 ) == 1 ) : #NEWLINE# #INDENT# return sorted_list [ ( len ( sorted_list ) / 2 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# right_median = sorted_list [ ( len ( sorted_list ) / 2 ) ] #NEWLINE# left_median = sorted_list [ ( ( len ( sorted_list ) / 2 ) - 1 ) ] #NEWLINE# return ( ( right_median + left_median ) / 2.0 )