Question: a) [10 pts] Define a function called three_sub_str that takes in as input a string and returns a string made of the first 3 and

 a) [10 pts] Define a function called three_sub_str that takes in

a) [10 pts] Define a function called three_sub_str that takes in as input a string and returns a string made of the first 3 and the last 3 characters from the input. If the string length is less than 3, then return the string Not Possible. Examples: 1. Input: 'watermelon'; Output: watlon 2. Input: 'try'; Output: trytry 3. Input: 'as'; Output: Not Possible [6] : #INSERT YOUR ANSWER HERE. b) [10 pts] Define a function five_reverse that takes as input a string and returns the reverse of the string if its length is a multiple of 5; else returns the original string. Examples: 1. Input: 'GreenApple'; Output: 'elppAneerG' 2. Input: 'RedApple'; Output: 'RedApple' [7 ] : #INSERT YOUR ANSWER HERE

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 Mathematics Questions!