Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

negative indexing in python

thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
print(thislist[-2:])

# ["melon","mango"]
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #negative #indexing #python
ADD COMMENT
Topic
Name
3+1 =