In this program, we will take a string as input and get the first 4 characters of a string.
Steps to solve the program
- Take a string as input.
- Print the first 4 characters of a string using Indexing.
#Input string
string = "Sqatools"
#Printing output
print(string[:4])
Output :
Sqat