Challenge 1: begin/rescue/ensure — Solution def safe_divide(a, b) begin a / b.to_f rescue ZeroDivisionError nil ensure puts "Division attempted" end end puts safe_divide(10, 2).inspect puts safe_divide(10, 0).inspect =begin Output: Division attempted 5.0 Division attempted nil Notes: - b.to_f forces float division (Chapter 2 of Course 1's integer-division gotcha) so safe_divide(10, 2) returns 5.0 rather than truncating. - rescue ZeroDivisionError catches only that specific error type — any other kind of exception would not be caught here and would propagate up normally. - ensure runs after both the successful call (10, 2) and the rescued call (10, 0) — "Division attempted" prints in both cases, before the return value is even displayed by puts. =end