Skip to content

Instantly share code, notes, and snippets.

@YisroelLen
YisroelLen / sum_two_smallest_numbers
Last active October 18, 2019 16:14
Coding Challenge description and explanation
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.