From 3a30176cd3ae43605d5b93c8ad8bf7dd4b63b5a9 Mon Sep 17 00:00:00 2001 From: sharan Date: Fri, 5 Oct 2018 19:21:24 +0530 Subject: [PATCH] solution to #1 - sum-of-all-numbers --- beginner/sum-of-all-numbers_sharan-nyn.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 beginner/sum-of-all-numbers_sharan-nyn.py diff --git a/beginner/sum-of-all-numbers_sharan-nyn.py b/beginner/sum-of-all-numbers_sharan-nyn.py new file mode 100644 index 0000000..6177df0 --- /dev/null +++ b/beginner/sum-of-all-numbers_sharan-nyn.py @@ -0,0 +1,5 @@ +def sum_all(numbers): + return sum(range(min(numbers), max(numbers)+1)) + +print sum_all([1,4]) +print sum_all([100,1]) \ No newline at end of file