Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python triangular number

def triangular_number(n):
    i = n
    while True:
        if i == 1:
            return n
        i -= 1
        n += i
Source by codereview.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #python #triangular #number
ADD COMMENT
Topic
Name
6+7 =