Slicing ======= .. toctree:: :maxdepth: 1 Indices and tables ------------------ * :ref:`genindex` * :ref:`modindex` * :ref:`search` Background ---------- Slicing is an often used feature of Python sequences. This set of exercises will give you an opportunity to try out the various things you can do with them. Exercise -------- Use the following string for the exercises in this section: .. code-block:: text There once was a town named Blooth 1) Get the first character of the string. 2) Get the last character of the string 3) Get every other character of the string, working from left-to-right. 4) Get every other character of the string, working from right-to-left. 5) Get the string in reverse 6) Extract just the name of the town. 7) Replace the word "town" with "city" 8) Create a copy of the string and prove whether the copy results in a new object or not. Explain your result. 9) Create a list from the string. Then, create a copy of that list and prove whether the copy results in a new object or not. Explain your result. Hints ----- Solution -------- When you are ready to see one possible solution, download and open this Jupyter Notebook :download:`file `