Skip to content

Commit 1ae9440

Browse files
Create sum_of_two_lowest
1 parent ceeb99b commit 1ae9440

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Simple Functions/sum_of_two_lowest

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# say you wanted to add the two lowest numbers in a list together. This can be simply solved as follows:
2+
3+
def sum_two_smallest_numbers(numbers):
4+
return sum(sorted(numbers)[:2])

0 commit comments

Comments
 (0)