Output is nearly correct, but whitespace differs. See highlig Input Your output Expected output compare output Input Output differs. See highlights below. Special character legend Your output 8005551212 Expected output (800) 555-1212 (800) 555-1212 9995551111 (999) 9555-1111 (999) 555-1111

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
icon
Related questions
Question
100%

I'm trying to code an output that will give any 10 digits in a phone number format. So far, all my code is working but I'm struggling on how to add parenthese and a hyphen without making unnecessary spaces. Thanks in advance.

X
zy Section 3.15- CSCI 1301: Program X
https://learn.zybooks.com/zybook/PIEDMONTCSCI1301
library > CSCI 1301: Programming Principles I home > 3.15: LAB: Phone number breakdown
1 phone_number = int(input())
2
3 phone_number1= phone_number // 10000000
4
5 phone_number2 = phone_number // 10000
6 phone_number2 = phone_number2 % 10000
7
Develop mode
2K+ (2454) Discord | #announcement X
LutzFall2023/chapter/3/section/15
8 phone_number3 = phone_number % 10000
9
10 print('(',phone_number1,')', phone_number2, '-', phone_number3)
11
12
Submit mode
Run program
Program output displayed here
Enter program input (optional)
If your code requires input values, provide them here.
Q Search
I
1
Q how to add parentheses to th
main.py
Run your program as often as you'd like, before submitting for
input values in the first box, then click Run program and obser
second box.
Input (from above) ->>
main.py
(Your program)
LEGION
-Output (
W
Transcribed Image Text:X zy Section 3.15- CSCI 1301: Program X https://learn.zybooks.com/zybook/PIEDMONTCSCI1301 library > CSCI 1301: Programming Principles I home > 3.15: LAB: Phone number breakdown 1 phone_number = int(input()) 2 3 phone_number1= phone_number // 10000000 4 5 phone_number2 = phone_number // 10000 6 phone_number2 = phone_number2 % 10000 7 Develop mode 2K+ (2454) Discord | #announcement X LutzFall2023/chapter/3/section/15 8 phone_number3 = phone_number % 10000 9 10 print('(',phone_number1,')', phone_number2, '-', phone_number3) 11 12 Submit mode Run program Program output displayed here Enter program input (optional) If your code requires input values, provide them here. Q Search I 1 Q how to add parentheses to th main.py Run your program as often as you'd like, before submitting for input values in the first box, then click Run program and obser second box. Input (from above) ->> main.py (Your program) LEGION -Output ( W
ooks.com/zybook/PIEDMONTCSC11301 LutzFall2023/chapter/3/section/15
> CSCI 1301: Programming Principles I home > 3.15: LAB: Phone number breakdown
9/6 W0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
AUTO
Latest submission - 12:53 PM EDT on 09/06/23
Only show failing tests
1:Compare output ^
Output is nearly correct, but whitespace differs. See highlights below. Special character legend
Input
Your output
2:Compare output
Expected output (800) 555-1212
Input
8005551212
Output differs. See highlights below. Special character legend
Your output
(800) 555-1212
Expected output
9995551111
(999) 9555-1111
(999) 555-1111
Q Search
NO
LEGION
W
Transcribed Image Text:ooks.com/zybook/PIEDMONTCSC11301 LutzFall2023/chapter/3/section/15 > CSCI 1301: Programming Principles I home > 3.15: LAB: Phone number breakdown 9/6 W0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, AUTO Latest submission - 12:53 PM EDT on 09/06/23 Only show failing tests 1:Compare output ^ Output is nearly correct, but whitespace differs. See highlights below. Special character legend Input Your output 2:Compare output Expected output (800) 555-1212 Input 8005551212 Output differs. See highlights below. Special character legend Your output (800) 555-1212 Expected output 9995551111 (999) 9555-1111 (999) 555-1111 Q Search NO LEGION W
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education