subject

Statisticians would like to have a set of functions to compute the median and mode of a list of numbers. The median is the number that would appear at the midpoint of a list if it were sorted. The mode is the number that appears most frequently in the list. Also include a function named mean, which computes the average of a set of numbers. The main() has been provided for you. Define the three functions median, mode, mean in a module named stats. py. Each function expects a list of numbers as an argument and returns a single number. Your program's output should look like the following: Mode: 2 Median: 2 Mean: 2 Given Code:
def main():
lyst = []
for i in range(6):
lyst. append(int(input('Enter a Value for the list: ')))
print("List:", lyst)
print("Mode:", mode(lyst))
print("Median:", median(lyst))
print("Mean:", mean(lyst))
if __name__ == "__main__":
main()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Ineed on my history if anyone can check out the last few questions i posted and i will be posting !
Answers: 2
question
Computers and Technology, 22.06.2019 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
You know the right answer?
Statisticians would like to have a set of functions to compute the median and mode of a list of numb...
Questions
question
Mathematics, 14.11.2020 01:00
question
Mathematics, 14.11.2020 01:00
question
English, 14.11.2020 01:00
question
English, 14.11.2020 01:00