Write a Python code that will read 10 numbers from the user, and then display the total
and the average of ONLY the odd numbers among those ten numbers.
1
Expert's answer
2021-09-06T00:16:36-0400
Num = str(input("Enter numbers followed by SPACE: ")).split(" ")
Sum=0n=0
for r in range(0,len(Num)):if(int(Num[r])%2==1):Sum = Sum + int(Num[r])
n=n+1
print("Sum of Odd Numbers : ",Sum)
print("Avg. of Odd Numbers: ",(Sum/n))
Comments