def binarySearch( a, l, r, num ):
m = (l+r) // 2
if l < r:
if num <= a[m]:
binarySearch(a, l, m, num)
else:
binarySearch(a, m+1, r, num)
else:
print( m )
If instead of print(m) i write return(m) and then try to print the function it returns None and I don't understand why. Can someone explain? Thanks