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
damaskus [11]
3 years ago
14

Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order func

tions to simplify the design.
Computers and Technology
1 answer:
lara [203]3 years ago
4 0

Answer:import functools

# open your file

file = open("integers.txt", 'r')

file = file.read()

# put numbers into a list

file = file.split()

# convert list into integers

file = list(map(int, file))

# use lambda function to get average.

print(functools.reduce(lambda x, y: x+y / len(file), file, 0))

Explanation:

You might be interested in
How would you cite the following source according to APA guidelines?
PSYCHO15rus [73]

B.Merriam-Webster's collegiate dictionary (10th ed.). (1993). Springfield, MA: Merriam-Webster.

In general, APA citations follow the format of;

<u>Contributors.(Date).Title. Publication Information</u>.  However, when there is no contributor information, write the name of the title first, followed by the date and the rest of the bibliographic data.



7 0
3 years ago
Read 2 more answers
Which of the following is NOT a reason to include comments in programs
wel

Answer:

C. Comments help document how code was written for other programmers to use.

Explanation:

I think it i C.

7 0
3 years ago
Read 2 more answers
What would be the advantage of driving in an arc smoothly instead of driving straight, turning, and driving straight again?
denis-greek [22]
Less emissions of gasses
7 0
3 years ago
Read 2 more answers
_________ enables customers to combine basic computing services,such as number crunching and data storage,to build highly adapta
Ghella [55]

Answer:

The correct answer to the question is option A (IaaS)

Explanation:

IaaS (Infrastructure as a Service) can be used for data storage, backup, recovery, web hosting, and various other uses as it is cost-effective, and it also has secured data centers. It is a service delivery method by a provider for cloud computing as it enables customers to be offered the service the possibility to combine basic computing services to build and direct access to safe servers where networking can also be done. These services rendered by the providers allow users to install operating systems thereby making it possible to build highly adaptable computer systems.

SaaS (Software as a Service): Here, the service provider bears the responsibility of how the app will work as what the users do is to access the applications from running on cloud infrastructure without having to install the application on the computer.

The cloud provider (CP) as the name suggests is anybody or group of persons that provide services for operations within the cloud.

7 0
4 years ago
Match the tasks with the professionals who do them.
disa [49]

Answer:

purchasing agent: negotiate contracts with suppliers

attend conferences and trade shows to find new products

office clerk: file paperwork according to a filing system in the office

type data into software to be used by the company

freight forwarder: calculate the weight and volume of cargo

track shipments to make sure that they arrive on time

5 0
3 years ago
Other questions:
  • Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50 scores). Print the scores i
    13·1 answer
  • Ruth knows the name of a presentation file and the folder it's in, but there are many files in that folder. How can Ruth quickly
    8·1 answer
  • An associate is seeking advice on which device to purchase for a friend who is a business owner. The friend needs the ability to
    13·1 answer
  • What is the statement describing? Agile team continuously adapt to new circumstances and enhance the methods of value delivery
    6·1 answer
  • The idea that managers tend to communicate more with other managers who share similar beliefs and experiences is represented by
    8·1 answer
  • Write a line of code to convert time to hours. Remember there are 60 minutes in an hour. Then write a line of code to calculate
    9·2 answers
  • What new information, strategies, or techniques have you learned that will increase your technology skills?
    14·1 answer
  • Imagine a typical website that works as a storefront for a business, allowing customers to browse goods online, place orders, re
    13·1 answer
  • Binary divide 1101011 by 111​
    5·2 answers
  • You want your computer to boot off of the network and have the ability to be brought out of sleep mode over the network. Which t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!