When you use a negative index, Python counts from the right : Index : List PYTHON TUTORIALS


PYTHON TUTORIALS » List » Index »

 

When you use a negative index, Python counts from the right


The last element is at position ? 

greeting = 'Hello'
print greeting[-1]



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo List
» Index