Horje
what does [::-1] mean in python Code Example
what does [::-1] mean in python
list[<start>:<stop>:<step>]
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




Python

Related
heads or tails python Code Example heads or tails python Code Example
how to do speed test with python Code Example how to do speed test with python Code Example
pygame collisions Code Example pygame collisions Code Example
Convert csv to dictionary in Python Code Example Convert csv to dictionary in Python Code Example
phone numbers Code Example phone numbers Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6