Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program 1 : phone.py For the first program in today's lab, you will need to write a program that formats a given phone number as
Program :
phone.py
For the first program in today's lab, you will need to write a program that formats a given phone number as input. Given an integer representing a digit phone number, output the area code, prefix, and line number using the format
If the input is:
The output in the terminal should be:
For simplicity, assume any part starts with a nonzero digit. So is not allowed.
Example Terminal Output:
Please enter your phone number:
Phone Number:
Hints
Use to get the desired rightmost digits.
a Ex: The rightmost digits of is gotten by which is
Use to shift right by the desired amount.
a Ex: Shifting right by digits is done by which yields Recall integer division discards the fraction
Skills Covered
Using the modulo and floor division operators
Deliverables
For this program you will need to provide the python file containing your code as well as a screenshot of the output of your program. Please name your files as follows:
Python Files
lastnamefirstnamefilename.py
For example: hawamdehfarisphone.py
Screenshots
lastnamefirstnamefilename.png
For example: hawamdehfarisphone.png
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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