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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started