Question

In: Computer Science

Python A survey gathers heights and weight of 50 participants and recorded the participants age as...

Python

A survey gathers heights and weight of 50 participants and recorded the participants age as ages=[40,56,46,58,79,70,67,46,32,91,92,93,47,95,69,56,50,30,9,29,29,0,31,21,14,18,16,18,76,68,6,9,78,81,71,91,01,69,78,77,54,59,59,41,51,48,49,76,10]

upd: do anything in Python using everything in the question

Solutions

Expert Solution

Note: If you require code for any other functionality please leave a comment.

A python code incorporating the above lists is as follows:

# function to find minimum value
def findMin(lis):
    return min(lis)


# function to find maximum value
def findMax(lis):
    return max(lis)


# function to find mean value
def findMean(lis):
    return sum(lis) / len(lis)


# given the list of ages
ages = [40, 56, 46, 58, 79, 70, 67, 46, 32, 91, 92, 93, 47, 95, 69, 56, 50, 30, 9, 29, 29, 0, 31, 21, 14, 18, 16, 18,
        76, 68, 6, 9, 78, 81, 71, 91, 1, 69, 78, 77, 54, 59, 59, 41, 51, 48, 49, 76, 10]
"""
We are going to find out the minimum age, maximum age 
and the mean age of all the people  surveyed.
We can pass the other lists of weights and height
to find minimum, maximum and mean weight and height.
"""
print("Minimum age is : ", end="")
print(findMin(ages))
print("Maximum age is : ", end="")
print(findMax(ages))
print("Mean age is : ", end="")
print(findMean(ages))

We are finding out the minimum maximum and the mean values of the list.

We can define similar functions to create more functionalities.

Screenshot of above code for reference:

Secreenshot of output :


Related Solutions

In a survey of U.S. women, the heights in the heights in the 20-29 age group...
In a survey of U.S. women, the heights in the heights in the 20-29 age group were normally distributed, with a mean of 64.2 inches and standard deviation of 2.9 inches. Find the probability that a randomly selected study participant has a height that is (a) less than 56.5 inches, (B) between 61 and 67 inches, and (c) more than 70.5 inches, and (D) indentify any unusual events, Explain your reasoning
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 69.7 inches and a standard deviation of 2.0 inches. A study participant is randomly selected. Complete parts​ (a) through​ (d) below. ​(a) Find the probability that a study participant has a height that is less than 65 inches. The probability that the study participant selected at random is less than 65 inches tall is . 0094. ​(Round to...
statistics In a survey of a group of​ men, the heights in the​ 20-29 age group...
statistics In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 69.1 inches and a standard deviation of 3.0 inches. A study participant is randomly selected.b) Find the probability that a study participant has a height that is between 65 and 72 inches.
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 67,4 inches and a standard deviation of 2.0 inches. A study participant is randomly selected. Complete parts​ (a) through​ (d) below. ​(a) Find the probability that a study participant has a height that is less than 68 inches. The probability that the study participant selected at random is less than 68 inches tall is nothing. ​(Round to four...
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 67.9 inches and a standard deviation of 4.0 inches. A study participant is randomly selected. a)Find the probability that a study participant has a height that is less than 67 inches. b) Find the probability that a study participant has a height that is between 67 and 72 inches. c)Find the probability that a study participant has a...
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 67.1 inches and a standard deviation of 3.0 inches. A study participant is randomly selected. Complete parts​ (a) through​ (d) below. (a) Find the probability that a study participant has a height that is less than 68 inches. The probability that the study participant selected at random is less than 68 inches tall is ___ (round to 4...
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 69.6 inches and a standard deviation of 2.0 inches. A study participant is randomly selected. a) Find a probability that a study participant has a height that is less than 66 inches. b) Find the probability that a study participant has a height that is between 66 and 72. c) Find the probability that a study participant has...
In a survey of a group of​ men, the heights in the​ 20-29 age group were...
In a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 69.3 inches and a standard deviation of 2.0 inches. A study participant is randomly selected. Complete parts​ (a) through​ (d) below. ​(a) Find the probability that a study participant has a height that is less than 65 inches. ​)​(b) Find the probability that a study participant has a height that is between 65 and 70 inches ​)​(c) Find...
n a survey of a group of​ men, the heights in the​ 20-29 age group were...
n a survey of a group of​ men, the heights in the​ 20-29 age group were normally​ distributed, with a mean of 67.8 inches and a standard deviation of 3.0 inches. A study participant is randomly selected. Complete parts​ (a) through​ (d) below. ​(a) Find the probability that a study participant has a height that is less than 67 inches. The probability that the study participant selected at random is less than 67 inches tall is nothing. ​(Round to four...
The table below contains information from a survey among 499 participants classified according to their age...
The table below contains information from a survey among 499 participants classified according to their age groups. The second column shows the percentage of obese people per age class among the study participants. The last column comes from a different study at the national level that shows the corresponding percentages of obese people in the same age classes in the USA. Perform a hypothesis test at the 5% significance level to determine whether the survey participants are a representative sample...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT