Write a python function to generate Triangular Number Series (1, 3, 6, 10, 15...)


Topic: Write a python function to generate Triangular Number Series (1, 3, 6, 10, 15...)

Solution

def triangle_numbers(n):
    for i in range(n):
        yield int(i*(i+1)/2)
        



List all Python Programs