Don't understand this python function

1 reply · 2K views · last reply
zeion
Messages
455
Reaction score
1

Homework Statement



Hi,

I'm not sure what this does:

s = 'hello'

I understand

s[::-1] would reverse the order of the letters and
s[1::] slices the first letter

but how come

s[1::-1] returns 'eh' ?


Homework Equations





The Attempt at a Solution