Common prefix and suffix ======================== Save all functions into the same file named ``presuffix.py``. #. Write the function :py:func:`common_prefix` that takes two strings each containing a word, and returns another string with the longest common prefix of these words. See the following examples: .. literalinclude:: prefix.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`prefix.txt` file. #. Write the function :py:func:`common_suffix` that takes two strings each containing a word, and returns another string with the longest common suffix of these words. See the following examples: .. literalinclude:: suffix.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`suffix.txt` file. .. rubric:: Solutions A solution of these functions is provided in the :download:`presuffix.py` file.