Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write and test the following function: def date _ extraction ( date _ number _ format ) : - - - -
Write and test the following function:
def dateextractiondatenumberformat:
Extracts the year, month, and day from a date number in the format MMDDYYYY
Use: year, month, day dateextractiondatenumberformat
Parameters:
datenumberformat a date number in the format MMDDYYYY int
Returns:
year year portion of datenumber int
month month portion of datenumber int
day day portion of datenumber int
Add the function to a PyDev module named functions.py Test it from
This is a rewrite of Assignment Task as a function.
The function must use integer division and modulus, not strings, to extract the date parts. The function does not ask for input and does no printing that is done by your test program.
Sample testing:
Enter a date in the format MMDDYYYY:
dateextraction
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started