In this program, we will take a string as input and get a string made of the first and last 2 chars
Steps to solve the program
- Take a list as input.
- Print the new string made of the first and last 2 characters from the given string using Indexing.
#Input string
string = "Sqatools"
#Printing output
print(string[:2]+string[-2:])
Output :
Sqls