Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions