+ 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
2 ответов
+ 3
if you work recursively, you have to apply return too.
insert a return before calling the finder.
+ 3
please share on code playground