Skip to content

Commit

Permalink
added sum_of_all_numbers solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Presley committed Oct 13, 2018
1 parent e4f77e9 commit 9414b25
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions beginner/sum_of_all_numbers_presleywong.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def sum_all(input_list):
if type(input_list) is not list:
return

total = 0
input_list.sort()
start = input_list[0]
end = input_list[-1]+1

for n in range(start, end):
total += n

return total

0 comments on commit 9414b25

Please sign in to comment.