Question

In: Computer Science

PYTHON please provide the complete function definition, full docstring with at least two examples A word...

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.

Solutions

Expert Solution

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"))


Related Solutions

Please the word surgery breakdown: 1. Provide the full term definition. 2. Identify and label the...
Please the word surgery breakdown: 1. Provide the full term definition. 2. Identify and label the (p)prefix, (s)suffix, and (wr)word root for each term (if applicable). 3. Define each word part by providing the most basic Latin or Greek meaning provided in the dictionary. sublingual, carcinogenic, cystocele, antenatal incision
Provide the definition of an Empirical Model, and provide two examples.
Provide the definition of an Empirical Model, and provide two examples.
Give good examples and write in complete sentences. Provide a definition and an example of each...
Give good examples and write in complete sentences. Provide a definition and an example of each of Marcia’s four identity statuses: a) identity diffusion (what the text described as role confusion); b) identity foreclosure; c) identity moratorium, and d) identity achievement.
Provide two examples of the use of present value techniques in accounting. Please have at least...
Provide two examples of the use of present value techniques in accounting. Please have at least 350 words and provide a reference please.
Question 3: What is Function? Explain with examples. Provide at least 2 program examples.
Question 3: What is Function? Explain with examples. Provide at least 2 program examples.
Please name at least two sustainability indices. 2. Provide examples of each index in a real...
Please name at least two sustainability indices. 2. Provide examples of each index in a real world context (list the context in which it was used, its value, and its significance in comparison to GDP)
In an answer of at least two well-developed paragraphs, provide a definition of the law of...
In an answer of at least two well-developed paragraphs, provide a definition of the law of demand and explain how it can be used to determine prices. Provide an example of your own to illustrate this concept.
EXAMPLES OF THERMODYNAMIC STATE FUNCTION WITH DEFINITION
EXAMPLES OF THERMODYNAMIC STATE FUNCTION WITH DEFINITION
Without plagiarism or copying word for word from the internet. Please write at least two strong...
Without plagiarism or copying word for word from the internet. Please write at least two strong paragraphs in response to the prompt below. Each paragraph should be 8-12 sentence for a total of 300-550 words. Use lots of examples. Describe/explain/summarize a mental health issue that you are familiar with and one that you would like to know more about.
1. List at least three examples that fit the definition of aggression, and at least one...
1. List at least three examples that fit the definition of aggression, and at least one that does not.  (Examples can be hypothetical or real) 2. Why do people deny the harmful effects of violent media when the research evidence linking violent media to aggression is so conclusive? 3. Consider the various causes of aggression described in this module and elsewhere, and discuss whether they can be changed to reduce aggression, and if so how
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT