Question: Coding Problem 2 Write a basic program that performs simple file and mathematical operations. a. Write a program that reads dates from input, one date
Coding Problem 2 Write a basic program that performs simple file and mathematical operations. a. Write a program that reads dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the find() method to parse the string and extract the date. The input ends with -1 on a line alone. Use the datetime module to get the current date. Ignore any dates that are later than the current date. Output each correct date as: 3/1/1990. b. After the program is working as above, modify the program so that it reads all dates from an input file inputDates.txt (an Example file is attached). c. Modify your program further so that after parsing all dates from the input file inputDates.txt, it writes out the correct ones into an output file called: parsedDates.txt. Ex: If the input is: -- March 1, 1990 April 2 1995 7/15/20 December 13, 2003 May 1, 2023 -1 -- then the output is: -- 3/1/1990 12/13/2003 -- Commit the changes to your .py into the repository. Don't include the output file. We will use a different input file for testing your code. Some of the points will be earned by making proper use of git by having multiple commits that show the evolution of your code over time so we can basically see your code at stages a., b., and c. .
PLEASE WRITE THE CODES IN PYTHON
THANK YOU!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
