Inconsistent Behavior Of Python Function Across Different Input Cases

Inconsistent Behavior Of Python Function Across Different Input Cases