Question: In Python without using a loop. Function name: triangular Parameters: integer Returns: a list Write a function called triangular that accepts one integer parameter that
In Python without using a loop.
Function name: triangular Parameters: integer Returns: a list Write a function called triangular that accepts one integer parameter that returns a list with the same number of terms as the value of the parameter. If the parameter is zero or a negative number, you should return an empty list A triangular number is the sum of a positive integer and all the integers before it. The series is as follows: 1, 3, 6, 10, 15, 21, >>> triangular(3) [1, 3, 6] >>> triangular (5) [1, 3, 6, 10, 15] >>> triangular (-2) []
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
