I need to createa function that takes in a list of tuples then outputs the total highest, lowest, average, and totals in each tupple.
For example: This is what it would take in:
([(99,86,70,7),(100, 96, 65, 10), (50, 40, 29, 11)])
I need a function that takes the highest int in each tuple, but only at index [0]. It needs to then average the numbers together at index [1], then find the lowest int at index [2], then just add up the values in the last index of each tupple.
So the output would look like this:
(100, 74, 29, 28)
This is what I have now. Its completely wrong and stupid and I find tuples very confusing. I'm trying to do this only using while
/for
loops but I'm just confused with the tuples and lists.
def grades(listt):
count=0
while count < len(listt):
x=();
for i in range(0, len(listt)):
x(listt(0[count])) > x(listt(i[count]))
print x[count]
print grades([(99,86,70,7),(100, 96, 65, 10), (50, 40, 29, 11)])