-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
1 Completes challenge and adds doctests
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from typing import List | ||
|
||
|
||
def sum_all(list_input: List[int]) -> int: | ||
"""Challenge | ||
- Write a function called sum_all() that takes a list of two numbers. | ||
- Return the sum of those two numbers plus the sum of all the numbers between them. | ||
Notes: | ||
The lowest number will not always come first | ||
>>> sum_all([1, 4]) | ||
10 | ||
>>> sum_all([4, 1]) | ||
10 | ||
""" | ||
return sum(range(min(list_input), max(list_input) + 1)) |