In this program, we will take a string as input and get a string made of the first and the last 2 chars from a given string
Steps to solve the program.
- Take a string as input.
- If the string consists of only 2 characters print True if not get a string made of the first and last 2 characters using indexing.
- Print the output.
Output :
list of strings and returns the length of the longest string.