4.16 LAB: Phone number breakdown Given an integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212. Ex: If the input is: 8005551212 the output is: (800) 555-1212 Hint: Use % to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which is 72. Hint: Use // to shift right by the desired amount. Ex: Shifting 572 right by 2 digits is done by 572 // 100, which yields 5. (Recall integer division discards the fraction). For simplicity, assume any part starts with a non-zero digit. So 0119998888 is not allowed. 328740 2125e98 gdzy7 LAB 4.16.1: LAB: Phone number breakdown 0/ 10 АCTIVITY main.py Load default template. 1 phone_number = int(input ()) *** Type your code here. .. 3 4 5
4.16 LAB: Phone number breakdown Given an integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212. Ex: If the input is: 8005551212 the output is: (800) 555-1212 Hint: Use % to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which is 72. Hint: Use // to shift right by the desired amount. Ex: Shifting 572 right by 2 digits is done by 572 // 100, which yields 5. (Recall integer division discards the fraction). For simplicity, assume any part starts with a non-zero digit. So 0119998888 is not allowed. 328740 2125e98 gdzy7 LAB 4.16.1: LAB: Phone number breakdown 0/ 10 АCTIVITY main.py Load default template. 1 phone_number = int(input ()) *** Type your code here. .. 3 4 5
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
please here is a screenshot of my lab phone number break down , python

Transcribed Image Text:# 4.16 LAB: Phone number breakdown
## Objective
Given an integer representing a 10-digit phone number, you need to output the area code, prefix, and line number using the format `(800) 555-1212`.
### Example
**Input:**
```
8005551212
```
**Output:**
```
(800) 555-1212
```
### Hints
- **Hint 1:** Use `%` to get the desired rightmost digits.
- Example: The rightmost 2 digits of `572` is obtained by `572 % 100`, which yields `72`.
- **Hint 2:** Use `//` to shift right by the desired amount.
- Example: Shifting `572` right by 2 digits is accomplished with `572 // 100`, resulting in `5`. (Recall that integer division discards the fraction).
**Note:** For simplicity, assume any part starts with a non-zero digit. Thus, `0119998888` is not considered valid.
## Lab Activity
**Task:** Complete the following code in `main.py`.
```python
phone_number = int(input())
''' Type your code here. '''
```
Complete the code to achieve the desired output format.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education