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
amm1812
3 years ago
14

Write a function called average() that takes a single parameter, a list of numeric values. The function should return the averag

e of the values in the list. If the list is empty, average() should return 0.
>>>lst = [1,3,4]

>>>average(lst)

2.6666666666666665

>>>average([])

0
Computers and Technology
1 answer:
QveST [7]3 years ago
3 0

Answer:

The following code is in python.

import statistics as st #importing statistics which include mean function.

def average(lst): #function average.

   return st.mean(lst)#returning mean.

lst=a = list(map(int,input("\nEnter the list : ").strip().split()))#taking input of the list..

print("The average is "+str(average(lst)))#printing the average.

Output:-

Enter the list :

1 2 3 4 5 6

The average is 3.5

Explanation:

I have used the statistics library which includes the mean function that calculates the mean or average of the list.In the function average having lst as an argument returns the mean of the list lst.

Then taking lst input from the user and printing it's average.

You might be interested in
A__ is a part of a GUI that allows a specific type of interaction with the user.
rosijanka [135]

The part of a graphic user interface (GUI) that allows a specific type of interaction with an end user is: D. widget.

<h3>What is a widget?</h3>

A widget is sometimes referred to as a gadget and it can be defined as a software application that is designed and developed as a part (element) of a graphic user interface (GUI) to display specific information or provide an end user with a specific way to interact with the computer's operating system (OS) or program.

<h3>The examples of a widget.</h3>

In Computer science, there are different types of widget and these include the following:

  • Search box widgets
  • Clock widgets
  • Weather widgets
  • Calculator widgets
  • Stock market widgets

In conclusion, the part of a graphic user interface (GUI) that allows a specific type of interaction with an end user is a widget.

Read more on widget here: brainly.com/question/7498108

4 0
3 years ago
In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
neonofarm [45]

Answer:

Real time

Explanation:

Real-time data processing is the execution of data in a short time period, providing near-instantaneous output. The processing is done as the data is inputted, so it needs a continuous stream of input data in order to provide a continuous output.

6 0
3 years ago
Think of—and explain—one or more ways that society could use big data
Komok [63]

Answer:

Naumann noted there are many positive ways to use big data, including weather prediction, forecasting natural disasters, urban and community planning, traffic management, logistics and machine efficiency, personalized healthcare, customized learning, autonomous vehicles, fraud detention, robotics, translation, smart ...

3 0
2 years ago
Today's Apple Mac computers run with the same internal hardware as the Windows-based PC.
sergejj [24]
I would say yes


If you look at the more modern Mac laptop or the MacBook Pro you will see that the core that is being used is an intel core m3 - m7 which would be a custom take on the intel cores i3 - i7 on an actual windows PC, when you compare them, both cores come from the same company and they both have power that is indicated by their name and rank as well as the motherboards which are made to support the cores which are usually under a 64 - bit architecture as far as my concern goes
6 0
3 years ago
Explain how the CPU processes data instructions
zepelin [54]

Answer: The working of the CPU is defined as a three-step process. First, an instruction is fetched from memory. Second, the instruction is decoded and the processor figures out what it's being told to do. Third, the instruction is executed and an operation is performed.

Explanation: Hope this helps

6 0
3 years ago
Other questions:
  • Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read
    6·1 answer
  • What are the best 3 xbox 360 games ?​
    10·2 answers
  • 1. The following programs require using arrays. For each, the input comes from standard input and consists of N real numbers bet
    15·1 answer
  • A(n) _________ is a lan that uses the same technologies as the internet but is provided to invited users outside the organizatio
    12·1 answer
  • What is virtualization?
    11·2 answers
  • Assume you have an Access database with five different tables, including various pieces of information about your client base. Y
    9·1 answer
  • Do word provides an undo button that can be used to cancel the most recent command or action
    13·1 answer
  • How to disable Fortinet?
    12·1 answer
  • What are the sectors of the buisness enviornment
    15·1 answer
  • Name various input and output devices used with computers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!