Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def small_gauss(n):
- """
- Returns the sum of 1...n
- Code to proof:
- >>> summer = lambda n: sum(m for m in range(1, n + 1))
- >>> summer(101)
- 5151
- """
- return (n ** 2 + n) // 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement