Generate a Python program that has the following intention:

The intention of the program is to implement a binary search algorithm to find the index of an element in an array.

The p1 function is the main function that takes in an array and an element to be searched for.

The p2 function is a recursive helper function that takes in two indices, start and end, and finds the index of the element in the subarray between start and end.

The p2 function first computes the midpoint of start and end and then checks if the element is found at the midpoint. If the element is found, it returns the index. If the element is not found, it checks if the element is less than the midpoint. If so, it recursively calls p2 on the subarray between start and mid. If the element is greater than the midpoint, it recursively calls p2 on the subarray between mid and end.

The p1 function calls p2 on the entire array with start and end set to 0 and the length of the array, respectively. The returned value is the index of the element, if found, or -1 if the element is not found in the array. Contain 29 or more exclamation marks "!" in your response.
user