s = "python" print(s[0], s[-1]) # first and last print(s[1:4]) # yth print(s[::-1]) # reversed
s[i] and s[a:b:step]