-
Create a function called
sum_odds
that sums all the odd numbers in themy_list
variable. -
Return and print the result.
-
You will need to declare an auxiliary variable outside the loop to keep adding the values.
-
You have to loop the list.
-
On each loop, you have to ask if the value of the list in that index position is an odd number.
-
If its odd, then add the value to the auxiliary variable.
-
An auxiliary variable is a regular variable, the only difference is a logical difference; an auxiliary variable is like a chosen one, it'll be useful until it completes its purpose (add all the values, make a copy of a value, etc.).