Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Accessing element using negative indexing

List = [1, 2, 'Softhunt', 4, '.net', 6, 'Tutorials']
 
# accessing an element using
# negative indexing
print("Accessing element using negative indexing")
 
# print the last element of list
print(List[-1])
 
# print the third last element of list
print(List[-5])
Comment

PREVIOUS NEXT
Code Example
Python :: Math Module fabs() Function in python 
Python :: matplotlib legend from scratch 
Python :: matplotlib 3d plot angle 
Python :: extract tables from image python 
Python :: cubic interpolation python 
Python :: unique character 01 
Python :: copy director structure python 
Python :: how to find the index of a specific number in pythong? 
Python :: python lambda to rename multiple variables name by replacing any appearance with underscore 
Python :: 0xff in python 
Python :: get channel name by channel id discord py 
Python :: get complete path from reletive path python 
Python :: linux show output 
Python :: docker python run subprocess python run docker interactively subprocess 
Python :: Python NumPy moveaxis function syntax 
Python :: text xml 
Python :: smile detection 
Python :: Python NumPy vstack Function Example with 1d array 
Python :: search recurse sub-folders using glob.glob module python 
Python :: python how to loop through array 
Python :: find max in for scartch python 
Python :: funcs_and_args for loop python 
Python :: NumPy unpackbits Code Unpacked array along axis 1 
Python :: selenium python select elements data atribute 
Python :: penggunaan items di python 
Python :: list python !g 
Python :: combination in python without itertools 
Python :: how to make a half pyramid in python 
Python :: integration test python 
Python :: pandas drop zeros from series 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =