Assignment
REQUIRED ACTIVITY
You are to develop a Python script to pre-process the file so that:
1. The header names are written as in the table above, and in that order. For example, we must have "Effective Date" instead of "EffectiveDate"; "DOB_Year" instead of "DOB Year"; "Plan_Type" instead of "Plan Type"; or "ProductID" instead of "PID".
2. The area code is exactly 3 digits and the home phone is exactly 7 digits. Analyze these two fields carefully to understand how you can design your script to capture issues such as +1 xxx xxxxxxx, or an area code with 3 digits, but a home phone with 10-digits still.
3. There cannot be a relationship D, S, or C that is Primary. If this occurs, your script must set the dependent as "N" (primary).
4. There cannot be a D, S, or C relationship without an identifying primary, or that is of plan type "Individual". A primary and a dependent are linked by their FamilyID. If this occurs, your script report must include an alert to the user about it.
5. All zip codes must be 5 digits
6. Months of birth must be between 1 and 12; and day of birth must be between 1 and 31 depending on the month of birth. For example, you cannot have a month of birth a 2 (i.e. February) and a day of birth as 30.
7. Year of birth must be 4 digits.
8. SSN must be 9 digits; not other character such as "-" or "."
9. Finally, your script must rearrange the records so that Primaries are processed before the dependents. In other words, primaries must come first.
Attachment:- Lab-Problem.rar