#!/usr/bin/env python # coding: utf-8 # # Extra List Slicing Exercise # The list slicing syntax: # # `sample_list[ start : end : step]` # # `start` is inclusive, `end` is exclusive. # # The default `start` is `0`, default `end` is the end, default `step` is `1`. # # Given the following list, please finish the exercises: # In[1]: sample_list = [0,1,2,3,4,5,6,7,8,9] # How can we get the first item? # In[2]: sample_list # How can we get the last item? # In[3]: sample_list # How can we get the first 3 items? # In[4]: sample_list # How can we get the last 3 items? # In[5]: sample_list # How can we get a copy of the list? # In[6]: sample_list # How can we get a copy of the list without first item? # In[7]: sample_list # How can we get a copy of the list without last item? # In[8]: sample_list