You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix-factorial-validation: Fix input validation and doctests
Fix factorial() input validation to use isinstance(number, int) instead of value comparison
Changes:
- Replace 'number != int(number)' with 'not isinstance(number, int)' in factorial()
- Fix doctests in factorial_recursive() to reference factorial_recursive() instead of factorial()
- Add negative test case for factorial(1.5) to verify non-integer rejection
This ensures consistent input validation between factorial() and factorial_recursive() functions.
0 commit comments