subject

Write a function called average() that takes a single parameter, a list of numeric values. the function should return the average of the values in the list. if the list is empty, average() should return 0.

> > > lst = [1,3,4]

> > > average(lst)

2.5

> > > average([])

0

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, kelseybell5522
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
image
Computers and Technology, 24.06.2019 13:50, jaystarr9395
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun, i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
image
Computers and Technology, 25.06.2019 03:00, achewitt3965
What judgment would you make about open systems interconnect? not useful that it is a technology that it is a model that it does not pertain to technology
Answers: 1
image
Computers and Technology, 25.06.2019 05:00, tshegofatso92
7. the cullerton park district holds a mini-olympics each summer. create a class named participant with fields for a name, age, and street address. include a constructor that assigns parameter values to each field and a tostring() method that returns a string containing all the values. also include an equals() method that determines two participants are equal if they have the same values in all three fields. create an application with two arrays of at least eight participants each—one holds participants in the mini-marathon, and the other holds participants in the diving competition. prompt the user for participant values. after the data values are entered, display values for participants who are in both events. save the files as participant. java and twoeventparticipants. java.
Answers: 2
You know the right answer?
Write a function called average() that takes a single parameter, a list of numeric values. the funct...

Questions in other subjects:

Konu
Mathematics, 18.03.2021 02:20