SHARE
TWEET

small gauss

DeaD_EyE Jun 8th, 2019 (edited) 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def small_gauss(n):
  2.     """
  3.    Returns the sum of 1...n
  4.    
  5.    Code to proof:
  6.    >>> summer = lambda n: sum(m for m in range(1, n + 1))
  7.    >>> summer(101)
  8.    5151
  9.    """
  10.     return (n ** 2 + n) // 2
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top