I need to write python code which uses slicing to return "ze" from the string "Malwarez!" I wrote this:
spam = "Malwarez!"
X = spam[-2:5:-1]
print(X)
However, I just came to the end result by randomly guessing the steps and stops. Can someone please explain how reverse negative indexing work?
Thx!