Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment: phoney Module, v . 2 CIT 3 0 9 0 0 What s the Big Idea? Update your existing phoney module to add additional
Assignment: phoney Module, v
CIT
Whats the Big Idea?
Update your existing phoney module to add additional cleaning logic to your cleanphonenumbers function.
IMPORTANT: Use Git to Branch Your Work
PRIOR to starting new code on this project, follow the instructions for using Git from the CIT workbook.
You MUST:
Create a local Git repository that contains all your files from v
Add all your files and create a commit
Create a new branch of the repository named v that preserves your work from the previous assignment
Switch back to the main branch and make your updates to the project as specified below
You MAY but are not required to:
Create a remote repository on GitHub.com
Push your code to your remote repository with the command
git push origin all
REMEMBER: Your GitHub.com repository should be set to PRIVATE
Obtain New Test Data
You are building on your previous version of this project.
HOWEVER, you MUST obtain a new set of phone numbers to use with this new version of your program!!
Instructions to obtain this data are on Canvas.
Updated Requirements
You will update your cleanphonenumbers function according to the following requirements:
Original Requirements
cleanphonenumbers: Accepts a list of phone numbers and returns a list of phone numbers that contain precisely digits. It removes any special characters from the numbers parenthesis hyphens and removes any number that is not precisely characters long
Additional Requirements
In North America, phone numbers consist of three parts: ABBCDDZZZZ where:
ABB: the area code
CDD: the exchange
ZZZZ: the station codeline of the individual
Using regular expressions, you should further filter the phone numbers according to the following rules:
The FIRST digit in the area code labeled A in the pattern above CANNOT be a or a
The FIRST digit in the exchange labeled C in the pattern above CANNOT be a or a
The EXCHANGE labeled CDD in the pattern above CANNOT be equal to
Hints
Do not try to accomplish all of the filtering in a single regular expression. Use multiple expressions to filter the list of phone numbers.
o It is possible to do this all in one, but thats not important right now. The purpose of this assignment is to learn how to apply regular expressions not become the worlds foremost expert on them.
Commit and Branch!
When you are finished with the updates to your program, do the following:
Add and commit your files using Git
Create another new branch named v that preserves your work at this point in the program
Switch back to the main branch
Optional Push all your branches to GitHub.com with the command git push origin all
Complete instructions can be found in the CIT workbook.
Submission Instructions
To submit, zip the following files and attach them to Canvas:
phoney.py
index.py
phonenumbers.csv NOT the sample CSV provided to you
Rubric
Requirement Points Available
Regular expression to find or at the start of the area code
Regular expression to find or at the start of the exchange
Regular expression to find exchanges that are
Total:
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