Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get value from list

list1 = ['physics', 'chemistry', 1997, 2000]
list2 = [1, 2, 3, 4, 5, 6, 7]

print("list1[0]: ", list1[0])
print("list2[1:5]: ", list2[1:5])

# Test Results:
list1[0]:  physics
list2[1:5]:  [2, 3, 4, 5]
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #python #list
ADD COMMENT
Topic
Name
1+1 =