Geek is very fond of patterns. Once, his teacher gave him a  pattern to solve. He gave Geek an integer n and asked him to build a pattern.
Help Geek to build a pattern.
 
Example 1:
Input: 5
Output:
1
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5
 
Your Task:
You don't need to input anything. Complete the function printTriangle() which takes  an integer n  as the input parameter and print the pattern.
Constraints:
	1<= N <= 20

Source: geeksforgeeks | Difficulty: EASY

Starter code: #User function Template for python3



class Solution:

    def printTriangle(self, N):

Solutions:
class Solution:

	def printTriangle(self, N):
		for i in range(1, N + 1):
			for j in range(1, i + 1):
				print(j, end=' ')
			print()


class Solution:

	def printTriangle(self, N):
		c = ''
		for i in range(1, N + 1):
			c += str(i) + ' '
			print(c)


class Solution:

	def printTriangle(self, N):
		for x in range(1, N + 1):
			for y in range(1, x + 1):
				if y == x:
					print(y)
					break
				print(y, end=' ')


class Solution:

	def printTriangle(self, N):
		i = 1
		while i <= N:
			j = 1
			while j <= i:
				print(j, end=' ')
				j += 1
			print()
			i += 1


class Solution:

	def printTriangle(self, N):
		ans = '1'
		print(ans)
		for i in range(2, N + 1):
			ans = ans + ' ' + str(i)
			print(ans)


class Solution:

	def printTriangle(self, N):
		for row in range(N):
			for col in range(row + 1):
				print(col + 1, end=' ')
			print()


class Solution:

	def printTriangle(self, N):
		l = range(1, N + 1)
		for i in range(N):
			print(*l[:i + 1], sep=' ')


class Solution:

	def printTriangle(self, N):
		k = 1
		for i in range(N):
			for j in range(0, i + 1):
				print(k, end=' ')
				k += 1
			k = 1
			print()
		return 0


class Solution:

	def printTriangle(self, N):
		arr = list(range(1, N + 1))
		for item in arr:
			print(*arr[0:arr.index(item) + 1])