This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_two_smallest_numbers(numbers): | |
# First let's get rid of any numbers that are below 0. | |
# We'll create a new list that will only have positive numbers in it. | |
new_list = [] | |
# Place the positive numbers in the list | |
for num in numbers: | |
if num >= 0: | |
new_list.append(num) | |
# Next we need to find the two lowest numbers in the list. | |
# There are several possibilities but we'll go with the simplest one. |