Final answer:
To find the sum of odd values in a list, you can iterate through the list and add the odd elements to a sum variable.
Step-by-step explanation:
To solve this problem, you can iterate through the list and check each element if it is odd. If the element is odd, you can add it to a sum variable. Finally, return the sum after iterating through the entire list. Here's an example function:
def sum_odds(lst):
sum = 0
for num in lst:
if num % 2 != 0:
sum += num
return sum
# Example usage
my_list = [1, 2, 3, 4, 5]
result = sum_odds(my_list)
print(result) # Output: 9