Question | Triangular Sum
Define triangular_sum
, which takes an integer n
and returns the sum of the first n triangle integer, while printing each of the triangle numbers between 1 and the nth triangle number.
The forumula for the nth Triangular number is:
(n + 1) * n / 2
def triangular_sum(n):
"""
>>> t_sum = triangular_sum(5):
1.0
3.0
6.0
10.0
15.0
>>> t_sum
35.0
"""
## YOUR CODE HERE ##