No, no such built-in method exists for list
s. It is trivial to find out if a list index is valid, so no function is needed. You could just put the code in your function (or the even more readable s[ind] if ind < len(s) else 0
) directly into the two or three places it's needed, and it would be perfectly understandable.
(Of course your code assumes ind
is always positive...)
If you do want to write a function, make it a method of a list
subclass.