Question 5
Evaluate:
Hint
Evaluate each substring value in the expression.
Key:
'string'[val]produces the character in indexvalfrom'string'.'string'[start:stop:step]: start from the character at indexstart, stop before the character at indexstop, and include characters in accordance to thestepvalue (1 by default)
Solution
If it were just 'Secret Gardens'[9:] or 'Secret Gardens'[9::], it would evaluate to 'rdens' with the default step value being simply 1.
A step value of -1, however, is the same as going through the characters of the string backwards (think how reverse() works with lists).
Hence, while it still starts with 'r', because we track backwards here, it produces 'raG terceS'.