to extract substring from a string in python just Use slice(). we can extract substrung from our string by using slice() method. Here we will use [] brackets. There is the format of [] is [start : stop : step] the first number is used for the start and the second one is used fot the end and the last one is used as a step. The first index of the string is a start element which is indexed by 0. And you can count the other elements on the basis if this starts element. The stop is reprent the last element of thge string and step is representing the value of incrementing each index. So here we can use the slice method to extract our substring from our string. So let's learn this method by giving the below example. Let's learn it. I hope this will help you. myString = "Hello guys how are you" print(myString[:]) print(myString[6 : ]) print(myString[ : 10]) print(myString[3 : 6]) print(myString[3 : -1]) Output : Hello guys how are you guys how are you Hello guys lo lo guys how are yo