Python Practice › Tuple Programs › Program 67
Average of a tuple
Write a Python program to calculate the average of a tuple’s elements.
Input
(5, 3, 9, 6)
Output
5.75
Approach
sum / len.
Solution
t = (5, 3, 9, 6)print(sum(t) / len(t))Output
5.75
Learn the concept
New to this topic? Read the lesson, then come back.