+ 3

Why 'return' is not working where 'print' is working properly?

I wrote a function in python which takes a list and a number, and then finds out where the number can be inserted in the list, like binary search. I used the same input that is given below. When I used return, it results 0, whereas when I used print, it results 8, the correct one. Please help me to find the problem and how to fix it. My code: https://code.sololearn.com/cNPJko72OY56/?ref=app

24th Sep 2020, 4:40 AM
Md. Faheem Hossain
Md. Faheem Hossain - avatar
2 ответов
+ 3
if you work recursively, you have to apply return too. insert a return before calling the finder.
24th Sep 2020, 6:22 AM
Oma Falk
Oma Falk - avatar
+ 3
please share on code playground
24th Sep 2020, 5:37 AM
Oma Falk
Oma Falk - avatar