PLEASE READ THIS QUESTION TILL THE END AND ANSWER FOR ALGORITHM 1…

Question Answered step-by-step PLEASE READ THIS QUESTION TILL THE END AND ANSWER FOR ALGORITHM 1… PLEASE READ THIS QUESTION TILL THE END AND ANSWER FOR ALGORITHM 1 WAS GIVEN BELOW AS REFERENCE AND PLEASE TRY TO SOLVE OTHER TWO ALGORITHMS IN THAT WAY USING DOCSTING AND BOOL METHOD.                                                THANK YOU IN ADVANCE  Algorithms:The Problem:Determine whether a string is a palindrome.A palindrome is a string that is read the same from front-to-back and back-to-front.Example: noon, racecarThere are several different approaches to solve this problem, known as algorithm.An algorithm is a sequence of steps that accomplish a task.Algorithms : PalindromeAlgorithm 1:Reverse the stringCompare the reversed string to the original string.For example: reverse of string ‘noon’ is also ‘noon’ – so ‘noon’ is a palindrome, but the reverse of string ‘dented’ is ‘detned’ – they are different and therefore ‘dented’ is not a palindrome.Algorithm 2:split the string into two halves (for odd number of length, omit the middle char)Reverse the second halfCompare the first half to the reversed second halfAlgorithm 3:Compare the first char to the last char of the stringCompare the 2 2nd char to the 2 2nd last charContinue until the middle of the string is reachedGoal: There might have other ways to solve this task, but you are supposed to write functions based on these three algorithms.ALGORITHM 1 ANSWER  def is_palindrome(s : str) -> bool:   ”’Returns true if and only if s is a palindrome    Note: based on algorithm 1   >>>is_palindrome(‘noon’)   >>>True   >>>is_palindrome(‘racecar’)   >>>True   >>>is_palindrome(‘dented’)   >>>False   ”’   return s[::-1] == s # s[::-1] reverses a stringUsed docstringUsed type hints in function definitionUsed proper commentsCode organized in readable format   Computer Science Engineering & Technology Python Programming CSCA 2000 Share QuestionEmailCopy link Comments (0)