- Write a function convert_date that takes an integer as aparameter and returns three integer values representing the inputconverted into days, month and year (see the functiondocstring).
Write a program namedt03.py that tests the function byasking the user to enter a number and displaying the output day,month and year. Save the function in a PyDev library module namedfunctions.py
A sample run for t03.py:
Enter a date in the format MMDDYYYY:05272017
The output will be:
27/05/2017
The function docstring is asfollows:
def convert_date(date_int): \"\"\"
-------------------------------------------------------
Converts date_intinto days, month and year use: day,month,year = convert_date(date_int)
-------------------------------------------------------
Paramaters:
date_int – (int > 0)
returns
day: the day in the month in date_int(int >= 0)
month: the monthin date_int (int >=0) year: the years in date_int (int>=0)
------------------------------------------------------- \"\"\"
- Test your program with 2 different date values than those givenin the example.
- You may assume that the user will only enter numbers (2 digitsfor month, 2 digits for days and 4 digits for year)
- You are not allowed to use any string methods or stringindexing.
- Copy the results to testing.txt.