(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)
ID: 3856617 • Letter: #
Question
(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)(PYTHON)
Write a function called isPalindrome that takes one parameter, a string (you may assume it is a string). This function should return True if and only if the input is a palindrome (same backwards as forwards). Do not treat capital letters, spaces, or punctuation differently.
Write a function called is Palindrome that takes one parameter, a string (you may assume it is a string). This function True if and only if the input is a palindrome (same backwards as forwards). Do not treat capital letters, spaces, or punctuation differently For example: should return Result Test print(isPalindrome("") ) print(isPalindrome ( "TACOCAT")) print(isPalindrome("?!")) True True FalseExplanation / Answer
def isPalindrome(string) :
for p,char in enumerate(string) :
if char != string[-p-1] :
return False
return True
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.