Question 3191Quiz 259
Programming and algorithmsWhat will be the output of the following Python code? def generate_pattern(n): result = [] for i in range(n): row = [] for j in range(i + 1): row.append(j + 1) result.append(row) return result pattern = generate_pattern(4) for line in pattern: print(line)
L09 · Programming and algorithms with Python