In this program, we will take a string as input and print the index of the character in a string.
Steps to solve the program
- Take a string as input.
- Find the index of the given character using index().
- Print the output.
#Input string
string = "Sqatools"
#Printing output
print("The index of q is: ",string.index("q"))
Output :
The index of q is: 1