If we want to select the first `n` elements of a list or the last `n` elements in a list, we could use the following code:
Slicing in Python is very flexible. If we want to select the first `n` elements of a list or the last `n` elements in a list, we could use the following code: