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
netineya [11]
3 years ago
15

Write a function named average_value_in_file that accepts a file name as a parameter and reads that file, assumed to be full of

numbers, and returns the average (mean) of the numbers in that file. The parameter, filename, gives the name of a file that contains a list of numbers, one per line. You may assume that the file exists and follows the proper format. For example, if a file named input.txt contains the following numbers
Computers and Technology
1 answer:
noname [10]3 years ago
6 0

def average_value_in_file(filename):

   f = open(filename)

   total = 0

   count = 0

   for x in f.read().splitlines():

       total += int(x)

       count += 1

   return total/count

print(average_value_in_file("input.txt"))

I used an input file that looks like this:

1

1

1

1

You might be interested in
Step into the year 2028. How are people viewing digital video? Or have we moved on to a completely new format?
WINSTONCH [101]

In the year 2028 I don't believe our digital video viewing experience would change too much considering most, if not all, the population is already satisfied with how easy, simple, and versatile our current experience is. If everything changes one thing will for sure remain unchanged. That one thing is cinemas, I don't think cinemas will ever change much as they provide a constant source of revenue while providing a place for family and friends to get together to watch a movie before it becomes available to other sources.


8 0
3 years ago
In computer science, what does the word security mean?
zepelin [54]

Answer:

B

Explanation:

Computer security, cybersecurity or information technology security (IT security) is the protection of computer systems and networks from information disclosure, theft of or damage to their hardware, software, or electronic data, as well as from the disruption or misdirection of the services they provide.[1]

4 0
2 years ago
You want to upgrade a server by installing an external SCSI tape drive. The system currently has a SCSI card and an internal SCS
jeka94

Answer:

You should disable termination on the Small Computer System Interface (SCSI) controller card.

Explanation:

SCSI is an acronym for Small Computer System Interface, which is also generally referred to as host bus adapter (HBA). The SCSI is typically a chip that controls the communication between the operating system (OS), storage devices such as hard disk drives and the host computer system. Also, it helps with the interpretation of the electrical signals between the Small Computer System Interface (SCSI) bus and the input-output bus for storage devices.

In this scenario, you want to upgrade a server by installing an external SCSI tape drive. The system currently has a Small Computer System Interface (SCSI) card and an internal SCSI hard drive. At bootup, the system fails to recognize the new tape drive. To solve this problem, you should disable termination on the SCSI controller card so that only the external SCSI tape drive will be active and the SCSI won't be detected.

6 0
2 years ago
Which two of the following are analog signals? A) whether a place of business is open or closed B) the volume of the radio C) th
ella [17]

Answer: B) The volume of the radio and D) the outdoor temperature.

Explanation:

The analog signal is the signal that continuously varying with the time and it continuous analog signal. Analog signal is basically used to carry information or data from one device to another device.

The volume of the radio is the example of the analog signal as it carry voice from one place to another. The analog signal  is the type of signal that use to measure the particular change in the physical phenomena like pressure, sound and temperature in the environment. So, outdoor temperature is also the example of analog signal.

And the other options (A) and (C) are incorrect because it is represent any physical change in the environment.  

8 0
3 years ago
Which of the following BEST represent the Scrum approach to planning?
evablogger [386]

Answer:

this is the answer I think

7 0
2 years ago
Other questions:
  • What will cloud cumputing offer
    15·1 answer
  • The ability to anticipate and determine upcoming driving hazards and conditions are adversely affected by stress.
    10·1 answer
  • Columns can be added to a page in the page layout tab in the blank grouping
    10·2 answers
  • You have just built a new system from scratch. you turn the computer on but the system boot fails and sounds a beep code. what m
    15·1 answer
  • Write a program that has an array of at least 50 string objects that hold people’s names and phone numbers. The program then rea
    12·1 answer
  • Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
    11·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • What are the tyoe of typical application of mainframe computer<br>​
    6·1 answer
  • Face book suggests Friends for users based on their
    13·1 answer
  • Give an example of what Artificial Intelligence application most popular is used on a daily basis.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!