Answers for "given a list from greatest to least with positive and negative numbers add only the negative numbers using for loop"

0

given a list from greatest to least with positive and negative numbers add only the negative numbers using for loop

given_list = [7, 5, 4, 4, 3, 1, -2, -3, -5, -7]

total = 0
for element in given_list2:
    if element < 0:
        total += element
print(total)
Posted by: Guest on September-16-2021

Code answers related to "given a list from greatest to least with positive and negative numbers add only the negative numbers using for loop"

Python Answers by Framework

Browse Popular Code Answers by Language