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