sa 11 cs chapter 12
10. Computing Mean. Computing the mean of values stored in a tuple is relatively simple. The mean is the sum o f the values divided by the number o f values in the tuple. That is,
# Code s = tuple(map(int, input(‘Enter a sequence of numbers : ‘).split())) # split() splits the input on whitespace, map() is converting the string types to integer types print(‘Mean of the above tuple is’, sum(s)/len(s)) # sum() gives the sum of any sequence