In python3, print() is a function and you must use parenthesis around the arguments.
As an example, line 15 should be more like
Looks to me like lo and hi are always integers, and 2 is an integer, so line 9 will default to integer division in python2. To keep the same behavior in python3, you'd need to replace the single slash with a double one.
As an example, line 15 should be more like
print(findinspt(y,3))Your example is older code and was written against python2, where this behavior was different. This is the most common issue you'll run into when converting from python2 to python3. (But default behavior of division and string handling are common as well).
Looks to me like lo and hi are always integers, and 2 is an integer, so line 9 will default to integer division in python2. To keep the same behavior in python3, you'd need to replace the single slash with a double one.
mid = (lo + hi) // 2