Doubt in the binary search program of lesson 1

I’m working the program in google colab. After the first test case it’s taking too much time for the remaining rest cases in binary search