6 Generate Triangle Numbers: You must use Python 3
Write a function called generateTriangleNumbers(). This functionwill take in an integer x and will return a list of integerscontaining the first x triangle numbers. The nth triangle number isthe sum of 1 + 2 + 3 + 4…(n − 1) + n. Some example input-outputpairs:
3 -> [1, 3, 6]
1 -> [1]
7 -> [1, 3, 6, 10, 15, 21, 28]
Answer
def generateTriangleNumbers(x): lst = [] total = 0 for i in range(1, x + 1): total
OR
OR