Question: ANSWER IN PYTHON Given an input representing a 10 -digit phone number, you will generate an output with the area code, sourrounded by parentheses, then
ANSWER IN PYTHON
Given an input representing a 10-digit phone number, you will generate an output with
the area code, sourrounded by parentheses, then a space
then the prefix, and
line number, separated by hyphens.
Ex: If the input is 8005551212, the output is:
(800) 555-1212
Hint: Use string indexing to get the appropriate pieces of the phone number. Remember that multiple arguments to the print statement automatically insert a space between the arguments.
Do not type your input into the optional input box below, rather, input in response to the prompts in the output window (prompts are given to you in the program template).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
