Please consider below code, I want to reversed the first two elements. That is target string is "abcd", the first two elements is "ab", and i need "ba". How can i use below code to do it? (I know i have alternative ways to do, but how to do in below way?)
r = "abcd"
t = r[1:0:-1]
print(t)
# print b
Another way:
r = "abcd"
t = r[1:-1:-1]
print(t)
# print NOTHING!