Question: Exercise-1: Create a function that fits the following specification: Name: String_reverse Argument: a string Return: a reversed string Here is an example of how to

Exercise-1: Create a function that fits the following specification:

Name: String_reverse Argument: a string Return: a reversed string

Here is an example of how to use (or test) the function: a = python rocks b = String_reverse(a) returns skcor nohtyp

Use the above function to check if a string is a palindrome or not. Print Yes if its a palindrome and no if it is not a palindrome. A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward. Examples: madam, nun, etc.

Exercise-2: Create a function that fits the following specification:

Name: Char_count Argument: a string Return: none Prints: frequencies of each character

Here is an example of how to use (or test) the function: Char_count(aababcdcd) Prints: a:3, b:2, c:2, d:2

Exercise-3: Write a general function that removes all occurrences of a string from another string.

Name: RmvChar_string Argument: string1, string2 Return: string1 without any character present in string2

Here is an example of how to use (or test) the function: a = abcdef b = gheijf c=RmvChar_string(a,b) print c # Prints: abcd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!