Question -
Answer -
To access value in lists, use the square brackets for slicking along with the index or indices to obtain value available at that index. Following is a simple example :
# !/user/bin/python
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]
When the above code is executed, it produces the following result:
list1 [0]: physics
list2[1:5] : [2, 3, 4, 5]