Question: python question ty 5. Function Three: phoneCheck Specification: Phone numbers in the United States consist of 10 digits. When dialing internationally, a country code must

python question ty

5. Function Three: phoneCheck Specification: Phone numbers in the United States consist of 10 digits. When dialing internationally, a country code must be prepended to the 10 digits (+1 is the United States country code). When people write down numbers, they frequently place different punctuation in various locations in the number to make it easier to read (e.g., (913) 268-3527, 913.456.9632, +1 (913) 439.2195). For this MP, a valid United States phone number either has 10 digits or a leading +1 followed by 10 digits. You may assume any 10 digits can be a valid number (even though no US numbers have a 555 area code for example). The third function you will write should be called phoneCheck. Your function should take one (1) argument: a string containing a phone number. The function should return one (1) string containing either Valid if the number is valid or Invalid if the number is invalid. To check for validity, the function should ignore the following punctuation: open parenthesis (; close parenthesis ); period .; hyphen -; and space . Any other non-digit characters (i.e., anything else that is not a 0-9) should result in the number being invalid. Additionally, the function should recognize +1 as a valid country code. Therefore, a plus + anywhere else in the number will result in the number being invalid. Additionally, valid number should have 10 digits (not counting the country code). Finally, numbers must start with either an open parenthesis (, a digit, or a +1. [Note: the numbers in the examples could be real but are unknown to me, please do not call them.]

python question ty 5. Function Three: phoneCheck Specification: Phone numbers in the

United States consist of 10 digits. When dialing internationally, a country code

5. Function Three: phoneCheck Specification: Phone numbers in the United States consist of 10 digits. When dialing internationally, a country code must be prepended to the 10 digits (+1 is the United States country code). When people write down numbers, the y frequently place different punctuation in various locations in the number to make it easier to read (e.g., (913) 268-3527, 913.456.9632, +1 (913) 439.2195). For this MP, a valid United States phone number either has 10 digits or a leading +1 followed by 10 digits. You may assume any 10 digits can be a valid number (even though no US numbers have a 555 area code for example). The third function you will write should be called 'phoneCheck'. Your function should take one (1) argument: a string containing a phone number. The function should return one () string containing either Vaild f the number is valid or 'znvalid' the number is invalid. close and space. Any other non-digit characters (i.e., anything else that is invalid. Additionaly,the function should recognize1 as a valid country code. Therefore, a plus'+'anywhere else in the number will result in the number being invalid. Additionally, valid number should have 10 digits (not counting the country code). Finally, numbers must start with either an open parenthesis (, a digit, or a +1'. [Note: the numbers in the examples could be real To check for validity, the function should ignore the following punctuation: open parenthesis parenthesis "; period; hyphen esult in the number being but are unknown to me, please do not call them.] The following numbers should result in the function returning Valid: 1(913) 382-9842 (913) 382-9842 913.382.9842

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!