def forgiving_float(value):
 try:
  return float(value)
 except (ValueError, TypeError):
  return value

def forgiving_float ( value ) : try : return float ( value ) except ( ValueError , TypeError ) : return value
try to convert value to a float .