summaryrefslogtreecommitdiff
path: root/python/sum-first-n.py
blob: 7a4edd1a471b4b6605103f3fddcf634f9b500388 (plain)
1
2
3
4
5
6
7
8
9
10
def s(n):
    i = n-1
    sum = 0
    while i >= 1:
        sum += i
        i -= 1
    return sum

print s(1500)