1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Strike441 [17]
4 years ago
10

Given a long 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 des

Computers and Technology
1 answer:
kaheart [24]4 years ago
4 0

Answer:

# User is prompted to enter phone number

phone_number = int(input("Enter your 10-digit phone number: "))

# this modulus operation will give the last 4 digit

# as the line number

line_number = phone_number % 10000

# this integer division will give a combination

# of area code and prefix

area_code_prefix = phone_number // 10000

# this integer division of the area_code_prefix

# will give the area_code

area_code = area_code_prefix // 1000

# this modulo operation of the area_code_prefix

# will give the prefix

prefix = area_code_prefix % 1000

# the phone number is printed in the specified format

print('(',area_code,')',' ',prefix,'-',line_number, sep='')

Explanation:

A sample image of program output is attached.

You might be interested in
When working with a spreadsheet, data analysts can use the _____ function to locate specific characters in a string.
jonny [76]

When working with a spreadsheet, data analysts can use the CLEAN function to locate specific characters in a string.

<h3>What is the CLEAN Function? </h3>

The CLEAN Function is known to be a tool that is often categorized in the Excel Text functions.

Note that this function tends to delete or remove any kind of non-printable characters from any specified or given text.

Note that As financial analysts, people tend to often import data from a lot of sources and the CLEAN function can help to delete nonprintable characters.

Hence, When working with a spreadsheet, data analysts can use the CLEAN function to locate specific characters in a string.

Learn more about spreadsheet from

brainly.com/question/4965119

#SPJ1

6 0
2 years ago
A web crawler uses a search _______ to traverse the web.​
aliina [53]
<span>A web crawler uses a search algorithm to traverse the web.
</span>The web crawler is responsible for the process of browsing the net. It systematically browses the World Wide Web<span> by looking at the keywords in the pages, the kind of content each page has and the links, and then return this information to the search engine.</span>
The process is called Web crawling or spidering.
7 0
3 years ago
Mục đính của thí nghiệm kiểm tra kĩ thuật
KIM [24]
Sorry i need points an i don’t understand✌
6 0
3 years ago
-FOR EXCEL AND WILL GIVE BRAINLIEST-
kaheart [24]

Answer:

I believe the answer is B. Click currency style button on the formatting toolbar

Explanation:

4 0
3 years ago
A domain account is one that is created on a Windows server domain controller (network) using (Describe Microsoft accounts)
Korvikt [17]

Answer:

s

Explanation:

3 0
3 years ago
Other questions:
  • Which of the following is an advantage of algorithmic thinking? Select all that apply.
    6·1 answer
  • Imagine your friend wants to apply
    5·1 answer
  • A special symbol that is used as an underlining structure to an agenda
    5·1 answer
  • Which tag provides information about a web site?
    12·1 answer
  • What properties make it suitable to be used for supportive frames
    15·1 answer
  • Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION" with the correct code segme
    9·1 answer
  • Assslainsdffddsvvdesdssbhasasco5m
    5·2 answers
  • Imagine that you are preparing a multimedia presentation. What are the four things you need to consider when getting started?
    14·2 answers
  • When scriptwriters are writing scripts, why do they have to write them in accordance with industry standards?
    9·1 answer
  • Write pseudo code that performs the following: Ask a user to enter a number. If the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!