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
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