safe_sqrt(n) that returns the square root of n (as a float) if n is a non-negative number, and returns the string "Invalid input" if n is negative. Validate before computing.safe_sqrt(16)
4.0
16 is non-negative, so its square root 4.0 is returned.
safe_sqrt(-4)
Invalid input
Negative input is rejected before any computation is attempted.
Check `if n < 0` before calling sqrt.
n ** 0.5 also computes a square root without importing math.