Skip to content

Commit 9f406fd

Browse files
committed
sheesh
1 parent 17a1b94 commit 9f406fd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Chapter 7/7.3.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
list = [-3, -5, -9, 5, 78,98]
2-
3-
def count_negitive(list):
4-
for i in list:
5-
sum(i for i in list if i < 0)
6-
print(count_negitive(list))
1+
def sumNegativeInts(userList):
2+
sum = 0
3+
for i in userList:
4+
if i < 0:
5+
sum += i
6+
return sum
7+
print(sumNegativeInts([-25, 5, -24, 36, 87]))

0 commit comments

Comments
 (0)