Quiz on Accessing Array Items in Python



1. What is the index of the first element in a Python list?
2. How do you access the last item of a list named 'my_list'?
3. If 'arr' is a list, what does 'arr[1:3]' return?
4. What will be the output of 'arr = [1, 2, 3]; arr[1]'?
5. Which of the following methods can be used to add an item to a list?

Advertisements