Strings In Depth4 / 19
Up next

Index and slice

s = "python"
print(s[0], s[-1])   # first and last
print(s[1:4])        # yth
print(s[::-1])       # reversed
What you're solving

s[i] and s[a:b:step]