BugSpotter LogoBugSpotterfor Python
Example Course

Sum Positive Values

Define a function called sum_positive_values(lst) which is passed a list as input. The function should return the sum of all positive integers in the input list.

Examples
  • sum_positive_values([1, 2, 3, 4, 5])15
  • sum_positive_values([1, -2, -3, -4, -5])1
Console
Info