Solution Review: Sublist of a List

This lesson will explain how to get the sublist from a list.

We'll cover the following

Solution:​ Use List Slicing

The solution is pretty straightforward; slice the list from the first index to the third index to obtain the first sublist, and then slice it from the third index to the end of the array to obtain the second sublist. This can be seen more clearly in the following illustration.

Get hands-on with 1000+ tech skills courses.