Question: In Python Exercise 4 Write a function to get a string s1 and returns a new string made of the first 2 and the last

In PythonIn Python Exercise 4 Write a function to get a string s1

Exercise 4 Write a function to get a string s1 and returns a new string made of the first 2 and the last 2 characters of the given string. If the string length is less than 2, return instead of the empty string. Sample Input 1 s1 = 'uabcs 2019' Expected Output 1 ua19 Sample Input 2 sl = 'ua' Expected Output 2 uaua Sample Input 3 s1 = 'u' Expected Output 2 "" (Empty String)

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!