takes value and repeatedly guesses the square root by making each new_guess the old_guess in the subsequent iteration the initial guess used here is listing shows function definition that accepts value and returns the square root of after making guesses againthe details of newton' method are hidden inside the function definition and the user does not have to know anything about the implementation to use the function for its intended purpose listing also shows the use of the character as comment marker any characters that follow the on line are ignored listing square_root function def square_root( )root #initial guess will be / of for in range( )root ( (root ( root)return root square_root( square_root( self check here is self check that really covers everything so far you may have heard of the infinite monkey theoremthe theorem states that monkey hitting keys at random on typewriter keyboard for an infinite amount of time will almost surely type given textsuch as the complete works of william shakespeare wellsuppose we replace monkey with python function how long do you think it would take for python function to generate just one sentence of shakespearethe sentence we'll shoot for is"methinks it is like weaselyou are not going to want to run this one in the browserso fire up your favorite python ide the way we will simulate this is to write function that generates string that is characters long by choosing random letters from the letters in the alphabet plus the space we will write another function that will score each generated string by comparing the randomly generated string to the goal third function will repeatedly call generate and scorethen if of the letters are correct we are done if the letters are not correct then we will generate whole new string to make it easier to follow your program' progress this third function should print out the best string generated so far and its score every tries self check challenge see if you can improve upon the program in the self check by keeping letters that are correct and only modifying one character in the best string so far this is type of algorithm in the review of basic python