Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Python
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
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