def average(tup):
""" ugiufh """
total = ((int(tup[0]) + int(tup[1]) + int(tup[2]))/3,
(int(tup[0]) + int(tup[1]) + int(tup[2]))/3,
(int(tup[0]) + int(tup[1]) + int(tup[2]))/3)
return total
I am writing a function to average the three elements in a tuple, which means that the original set = (1, 2, 3), which gives me a tuple = (2, 2, 2)
My question is, is there a way to condense what I wrote to give me the same answer? If so, how to condense it?
thank
source
share