safe_divide(a, b) returning a / b, but returning None when b is zero — by catching <code>ZeroDivisionError</code>, not by pre-checking b == 0 (the point is practicing EAFP style).safe_divide(10, 4)
2.5
Normal division.
safe_divide(5, 0)
None
The exception is caught and None returned.
Wrap just the division in try.
The except block returns None.