toddler's standing in front of beige concrete stair
Photo by Jukan Tateisi on Unsplash

The index in a string is the position of a substring that is part of that string.

When you want to check whether a string in Python starts with a specific character, you can specify the index 0 and write the name of the variable of the string in front:

There is also another way you can do that. There is a built-in method in Python that you can use to check whether a string starts with a specific character that is called startswith():

That’s basically it. I hope you find this useful.