id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 04_lists > sum_negatives
prev  |  next  |  chance

Define a function that when passed a list, returns the sum of all negative numbers in the list.


sum_negatives([10, 70, 20, 90]) → 0
sum_negatives([-10, 70, 20, -90]) → -100
sum_negatives([-1, -2, -3, -4, -5, -6, -7, -8, -9, -10]) → -55

...Save, Compile, Run (ctrl-enter)

def sum_negatives(data):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 1 Post-solution available

Copyright Nick Parlante 2017 - privacy