Parse a string to a float without crashing on bad input.
Constraints
Example
>>> safe_float("3.14")
3.14
>>> safe_float("hello")
None
>>> safe_float(None)
None
>>> safe_float("1e3")
1000.0
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints