diff --git a/python/beginner/sum_of_all_numbers_vinimlo.py b/python/beginner/sum_of_all_numbers_vinimlo.py new file mode 100644 index 0000000..e8e7249 --- /dev/null +++ b/python/beginner/sum_of_all_numbers_vinimlo.py @@ -0,0 +1,13 @@ +def sum_all(list): + sum = 0 + if(list[0] < list[1]): + for i in range(list[0], list[1]+1): + sum += i + else: + for i in range(list[1], list[0]+1): + sum += i + return sum + +# sum_all([1, 4]) + +print(sum_all([1, 4]))