In: Computer Science
PYTHON
please provide the complete function definition, full docstring with at least two examples
A word is a palindrome if it the same read forwards and backwards. We will call a word a fuzzy palindrome if it is the same read forwards and backwards, except for possible differences in case. For example, both 'tattarrattat' and 'TaTtArRAttat' are fuzzy palindromes. Define a function is_fuzzy_palindrome that returns True if and only if its argument is a fuzzy palindrome.
input code:
output:
code:
def is_fuzzy_palindrome(str1):
'''in this function we check the string it read forward and
backward
is same or not if not same than return False else return
True'''
'''make string into uppercase'''
str1=str1.upper()
'''take a loop'''
for i in range(len(str1)):
'''check upper and lower is same or not'''
if(str1[i]!=str1[len(str1)-1-i]):
'''not same than return False'''
return False
'''else return True'''
return True
'''call the function'''
print(is_fuzzy_palindrome("tattarrattat"))
print(is_fuzzy_palindrome("TaTtArRAttat"))