Binary Search Algorithm Python Code For Snake