您将忽略递归调用的返回值。您还需要 显式地 返回它们:
elif input[mid] > target: return bisect(input[:mid], target)elif input[mid] <= target: return bisect(input[mid:], target)
递归调用与其他任何函数调用一样;他们将结果返回给调用者。如果忽略返回值,然后调用函数结束,那么您将以该调用函数结束,然后返回
None。

您将忽略递归调用的返回值。您还需要 显式地 返回它们:
elif input[mid] > target: return bisect(input[:mid], target)elif input[mid] <= target: return bisect(input[mid:], target)
递归调用与其他任何函数调用一样;他们将结果返回给调用者。如果忽略返回值,然后调用函数结束,那么您将以该调用函数结束,然后返回
None。