Python List Exercises

In this page you can find interactive exercises to practice Python’s List data structure and its methods.

If you’d like to practice List Comprehensions, a more advanced Python List concept, you can click here.

Exercises aim to gradually increase in difficulty. 

So, let’s start.

Exercise 6-a: Calling Elements of a Python List (Index 0)

Assign the first element of the list to answer_1 on line 2


list[index]

Correct syntax to call a list’s element is brackets with the index number inside next to the list’s name: 

 

List index starts with zero.

answer_1 = lst[0]

Exercise 6-b: Calling List Elements and Indexing

And let's print the second element directly inside print function.


This time print the second element of the list directly on line 3. You should get 100.


last element is easiest to print with reverse indexing, which starts with -1.

answer_1=lst[-1]