python get item from list by index

Solutions on MaxInterview for python get item from list by index by the best coders in the world

showing results for - "python get item from list by index"
Noa
25 Jun 2016
1list1 = ['physics', 'chemistry', 1997, 2000];
2list2 = [1, 2, 3, 4, 5, 6, 7 ];
3
4print("list1[0]: ", list1[0])
5print("list2[1:5]: ", list2[1:5])
6
7# Results:
8# list1[0]:  physics
9# list2[1:5]:  [2, 3, 4, 5]
similar questions
queries leading to this page
python get item from list by index