📜  [::-1] 在 python 代码示例中是什么意思

📅  最后修改于: 2022-03-11 14:45:03.214000             🧑  作者: Mango

代码示例1
list[::]
So, when you do MyList[::-1], its starts from the end towards the begining taking each element by a step of 1 (hence -1). So, its reversing the list. Applicable to tuples as well