reset password
Author Message
rabbott
Posts: 1649
Posted 16:57 Mar 04, 2019 |

Why does x[::-1] return the same values as reversed(x)?

These stack overflow answers, A and B, explain it. As answer A says, the slice code tries to guess what you want and then gives it to you. In the B answer, the answer with 346 votes enumerates the possibilities.

Last edited by rabbott at 17:05 Mar 04, 2019.