List offset : List Indexing : List PYTHON examples


PYTHON examples » List » List Indexing »

 

List offset


List offset: start at zero, negative and slicing
 

L = ['spam', 'Spam', 'SPAM!']

print L[2]                               # offsets start at zero

print L[-2]                              # negative: count from the right

print L[1:]                              # slicing fetches sections


           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo List
» List Indexing