Normally we use the slice method to getting a substring from a string in Python
But like PHP and Perl, Python also has a function which is Substr() it works as follows:-
s = Substr(s, beginning, LENGTH)
If you are familiar with Python then you must know that it expects beginning and one after END.
So the correct replacement for Substr(s, beginning, LENGTH) is
s = s[ beginning : beginning + LENGTH]
To know more about this you can have a look at the following video tutorial:-