Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Accessing range() with index value

# welcome to softhunt.net

element = range(5)[0]
print("First element:", element)

element = range(5)[-1]
print("Last element:", element)

element = range(5)[3]
print("Fourth element:", element)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Accessing #index
ADD COMMENT
Topic
Name
4+7 =