Friday, 16 February 2024

Class 11 CS Practical - 52

 

52 - Write a program in Python to find the mean of numeric values stored in the given tuple.

T=eval(input("Enter a numeric tuple: "))

print("Tuple is: \n", T)

mean=sum(T)/len(T)

print("Mean of the numeric values of the tuple = ",mean)


Output:

Enter a numeric tuple: (2, 8, 9, 6, 5)

Tuple is: 

 (2, 8, 9, 6, 5)

Mean of the numeric values of the tuple =  6.0





No comments:

Post a Comment