I have the following program:
str = 'abcd'
l = len(str)
str2 = str[l-1:0:-1]
print(str2)
str2 = str[l-1:-1:-1]
print(str2)
Why does the first print()
output dcb
and the second print()
output an empty string ? Why doesn't the second print()
output dcba
?