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
Step: 1
Get Instant Access with AI-Powered 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