a=eval(input("Enter some of tuple numbers"))
l=len(a)
sum=0
for x in a:
sum=sum+x
print("The sum=",sum)
print("The avg=",sum/l)
output:
Enter some of tuple numbers(10,20,30)
The sum= 60
The avg= 20.0
l=len(a)
sum=0
for x in a:
sum=sum+x
print("The sum=",sum)
print("The avg=",sum/l)
output:
Enter some of tuple numbers(10,20,30)
The sum= 60
The avg= 20.0
No comments:
Post a Comment