Write a python program that asks the user to input six numbers and then print the summation and average of odd numbers only.
Sample Input:
3
5
2
4
8
9
Sample Output: Summation is 17 and average is 5.666666666666667
n=input('Enter the integers seperated by comma :')
x=n.split(',')
z=[]
for i in x:
if int(i)%2!=0:
z+= [int(i)]
print(z)
print('sum',sum(z))
print('average',sum(z)/len(z))
Comments
Leave a comment