if values[midxidx mid return "searched element not in the listl [ print(intpolsearch( )outputfound at index looping and counting the following program counts the number of times the letter "rappears in stringword 'raspberrycount for letter in wordif letter =' 'count count print(countthis program demonstrates another pattern of computation called counter the variable count is initialized to and then incremented each time an "ris found when the loop exitscount contains the resultthe total number of ' "peanut buttercount for char in sif char =" "count count print(countoutputthe letter appears times in "peanut butter string methods python has set of built-in methods that you can use on strings noteall string methods returns new values they do not change the original string