Write a program to calculate and display the sum of all the odd numbers in the list.
Write a program to calculate and display the sum of all the odd numbers in the list.
9 views
1 Answers
pos = 0
sum = 0
while pos < len (L):
if L[pos] %2 = = 1 :
sum = sum + L [pos]
pos = pos + 1
print sum
9 views
Answered