Question: In some web forms, users must enter a phone number, and some of these aggravate users by accepting only a specific format. You have been

In some web forms, users must enter a phone number, and some of these aggravate users by accepting only a specific format. You have been hired to write a program that reads U.S. phone numbers with the three-digit area and seven-digit local codes accepted as ten digits, or separated into blocks using hyphens or spaces, and with the area code optionally enclosed in parentheses. For example, all of these are valid: 555-123-1234, (555) 1234567, (555) 123 1234, and 5551234567. Read the phone numbers from user input and for each one echo the number in the form (999) 999 9999 or report an error for any that are invalid, or that dont have exactly ten digits.

Please write the code in python with proper identation of code. also provide the output. Need the solution ASAP

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!