As part of validating text produced by Altair HyperWorks, write a function that determines whether a given string is a palindrome. A palindrome reads the same from left to right and right to left.
Comparison is case-sensitive, and every character, including spaces and punctuation, must be considered. Return True when the string is a palindrome and False otherwise. An empty string is considered a palindrome.
Implement is_palindrome(s), where s is a string. Return a Boolean value:
True if s equals its reverse.False otherwise.You should compare characters from both ends toward the center rather than creating a reversed copy of the string.
def is_palindrome(s):