Dates ===== Save all functions into the same file named :file:`dates.py`. #. Write the function :py:func:`age` that takes the birth date of a person and the present date, and returns the age of the person. Each date is represented with three integers (:py:class:`int`): day, month and year. Example: .. literalinclude:: dates1.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`dates1.txt` file. #. Write the function :py:func:`complete_year` that takes a year and a century. The value of the year is between 0 and 99, and returns the complete year computed by adding the century to the year. Example: .. literalinclude:: dates2.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`dates2.txt` file. #. Write the function :py:func:`age_21` that takes the same parameters as function :py:func:`age`, and returns the age of the person. This function :py:func:`age_21` has to deal with completely represented years (as 1976 or 2003) or with years represented without the century. We will suppose that the years without century (between 0 and 99) are from the XXI century. This function must call the previous functions :py:func:`age` and :py:func:`complete_year`. Example: .. literalinclude:: dates3.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`dates3.txt` file. #. Write the function :py:func:`compare_dates` that takes 6 integers `day1`, `mont1`, `year1`, `day2`, `month2` and `year2`, that represent two dates, and returns -1 if the first date is previous to the second date, 0 if they are the same date and 1 if the first date is later to the second one. Example: .. literalinclude:: dates4.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`dates4.txt` file. #. Write the functions :py:func:`previous_date`, :py:func:`same_date` and :py:func:`later_date` that take two dates each, and return `True` if the first date is previous, equal or later to the second one respectively. Otherwise they return `False`. You must call function :py:func:`compare_dates`. Example: .. literalinclude:: dates5.txt :language: python3 :lines: 3-11 .. note:: More tests are provided in the :download:`dates5.txt` file. .. rubric:: Solutions A solution of these functions is provided in the :download:`dates.py` file.