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 star pattern.
 
Example 1:
Input: 5
Output:
* 
* * 
* * * 
* * * * 
* * * * *
* * * *
* * *
* *
*
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):

        # Code here

Solutions:
class Solution:

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


class Solution:

	def printTriangle(self, N):
		for i in range(1, 2 * N):
			if i > N:
				i = 2 * N - i
			for j in range(i):
				print('*', end=' ')
			print()


class Solution:

	def printTriangle(self, n):
		for i in range(1, 2 * n - 1 + 1):
			star = i
			if i > n:
				star = 2 * n - i
			for j in range(1, star + 1):
				print('*', end=' ')
			print()


class Solution:

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


class Solution:

	def printTriangle(self, N):
		for i in range(1, 2 * N, 1):
			temp = 0
			if i > N:
				temp = 2 * N - i
			else:
				temp = i
			j = 0
			for j in range(temp):
				print('*', '', end='')
				j += 1
			print()
			i += 1


class Solution:

	def printTriangle(self, N):
		for x in range(1, N + 1):
			print('* ' * x)
		for x in range(N - 1, 0, -1):
			print('* ' * x)


class Solution:

	def printTriangle(self, N):
		k = N * 2 - 1
		val = 1
		for i in range(k):
			for j in range(val):
				print('*', end=' ')
			print()
			if i < k // 2:
				val += 1
			else:
				val -= 1


class Solution:

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


class Solution:

	def printTriangle(self, n):
		for i in range(1, n + 1):
			print('* ' * i)
		for i in range(n - 1, 0, -1):
			print('* ' * i)


class Solution:

	def printTriangle(self, n):
		for i in range(1, 2 * n):
			if i <= n:
				stars = i
			else:
				stars = 2 * n - i
			for j in range(stars):
				print('*', end=' ')
			print()


class Solution:

	def printTriangle(self, n):
		for i in range(1, n + 1):
			st = i
			sp = n - i
			print('* ' * st + ' ' * sp)
		for i in range(1, n):
			st = n - i
			sp = i
			print('* ' * st + ' ' * sp)


class Solution:

	def printTriangle(self, N):
		arr = list(range(1, N + 1))
		new_arr = []
		for item in arr:
			new_arr.append('* ' * item)
		new_arr2 = new_arr[0:N - 1]
		new_arr2.sort(reverse=True)
		ultra_list = new_arr + new_arr2
		for item in ultra_list:
			print(item)


class Solution:

	def printTriangle(self, N):
		for x in range(1, N + 1):
			for y in range(x):
				print('* ', end='')
			print()
		for x in range(N - 1, 0, -1):
			for y in range(x):
				print('*', end=' ')
			print()
		return


class Solution:

	def printTriangle(self, N):
		for i in range(1, 2 * N):
			if i <= N:
				print('* ' * i)
			else:
				print('* ' * (2 * N - i))


class Solution:

	def printTriangle(self, N):
		for j in range(1, N + 1):
			for l in range(1, j + 1):
				print('*', end=' ')
			print()
		for m in range(N - 1, 0, -1):
			for o in range(1, m + 1):
				print('*', end=' ')
			print()


class Solution:

	def printTriangle(self, N):
		for i in range(1, 2 * N):
			stars = i
			if i > N:
				stars = 2 * N - i
			s = ''
			for j in range(1, stars + 1):
				s += '* '
			print(s)