Given string str of a constant length, print a triangle out of it. The triangle should start with the first character of the string and keep growing downwards by adding one character from the string.
The spaces on the left side of the triangle should be replaced with a dot character. 
Example 1:
Input:
str = "geeks"
Output:
....g
...ge
..gee
.geek
geeks
Example 2:
Input:
str = "thisi"
Output:
....t
...th
..thi
.this
thisi
Your Task:  
You don't need to read input. Your task is to complete the function printTriangleDownwards() which takes the string str as an input parameter and prints the required triangle.
Expected Time Complexity: O(N*N), Where N is the size of input string.
Expected Auxiliary Space: O(1)
Constraints:
1 <= |str| <= 500

Source: geeksforgeeks | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: #User function Template for python3

class Solution:

    def printTriangleDownwards(self, s):
        # code here

Solutions:
class Solution:

	def printTriangleDownwards(self, s):
		N = len(s)
		for i in range(1, N + 1):
			dots = '.' * (N - i)
			s1 = s[:i]
			print(dots + s1)


class Solution:

	def printTriangleDownwards(self, s):
		for i in range(len(s) - 1, 0, -1):
			print('.' * i + s[:-i])
		print(s)


class Solution:

	def printTriangleDownwards(self, s):
		res = []
		for i in range(len(s) + 1):
			res.append('.' * (len(s) - i) + s[:i])
		for i in range(1, len(res)):
			print(res[i])


class Solution:

	def printTriangleDownwards(self, s):
		n = len(s)
		for i in range(n):
			for j in range(n - i - 1):
				print('.', end='')
			for j in range(i + 1):
				print(s[j], end='')
			print()


class Solution:

	def printTriangleDownwards(self, s):
		for x in range(len(s)):
			for y in range(x, len(s) - 1):
				print('.', end='')
			print(s[0:x + 1])


class Solution:

	def printTriangleDownwards(self, s):
		n = len(s)
		dt = n - 1
		st = 1
		for i in range(1, n + 1):
			k = 0
			for j in range(1, dt + 1):
				print('.', end='')
			for j in range(1, st + 1):
				print(s[k], end='')
				k = k + 1
			st = st + 1
			dt = dt - 1
			print()


class Solution:

	def printTriangleDownwards(self, s):
		for (i, j) in enumerate(s):
			print((len(s) - i - 1) * '.' + s[:i + 1])


class Solution:

	def printTriangleDownwards(self, s):
		x = len(s)
		for i in range(x):
			a = s[:i + 1]
			a1 = x - len(a)
			while a1 > 0:
				print('.', end='')
				a1 -= 1
			print(a)


class Solution:

	def printTriangleDownwards(self, s):
		z = ''
		for i in s:
			z += i
			print((len(s) - len(z)) * '.', end='')
			print(z)


class Solution:

	def printTriangleDownwards(self, s):
		i = -1
		while i < len(s):
			if i >= 0:
				print('.' * (len(s) - i - 1) + s[:i + 1], end='\n')
				i += 1
			else:
				i += 1


class Solution:

	def printTriangleDownwards(self, s):
		n = len(s)
		t = '.' * n
		for i in range(1, n + 1):
			print(t[i:] + s[:i])
		return


class Solution:

	def printTriangleDownwards(self, s):
		l = len(s)
		str = ''
		for i in range(l):
			str = str + s[i]
			print('.' * (l - i - 1) + str)


class Solution:

	def printTriangleDownwards(self, s):
		for i in range(len(s)):
			c = 0
			for j in range(len(s)):
				if j < len(s) - i - 1:
					print('.', end='')
				else:
					print(s[c], end='')
					c += 1
			print()


class Solution:

	def printTriangleDownwards(self, s):
		a = len(s)
		for i in range(len(s)):
			a = a - 1
			for j in range(a):
				print('.', end='')
			print(s[0:i + 1])


class Solution:

	def printTriangleDownwards(self, s):
		self.s = s
		pattern = ''
		length = len(s)
		for i in range(length):
			pattern = '.' * (length - i - 1) + s[:i + 1]
			print(pattern)


class Solution:

	def printTriangleDownwards(self, s):
		n = len(s)
		a = ''
		for i in range(len(s)):
			for j in range(i, len(s)):
				for k in range(int(n - 1) - j):
					print('.', end='')
				a += s[j]
				print(a)
				break


class Solution:

	def printTriangleDownwards(self, s):
		l = len(s)
		for i in range(l):
			for j in range(l - i - 1):
				print('.', end='')
			for k in range(0, i + 1):
				print(s[k], end='')
			print()


class Solution:

	def printTriangleDownwards(self, s):
		op = ''
		k = len(s)
		for i in range(k):
			op = '.' * (k - (i + 1)) + s[:i + 1]
			print(op)


class Solution:

	def printTriangleDownwards(self, s):
		l = []
		for i in range(1, len(s) + 1):
			l.append(s[:i])
		for i in l:
			m = '.' * (len(s) - len(i)) + i
			print(m)


class Solution:

	def printTriangleDownwards(self, s):
		l = []
		e = ''
		for i in range(len(s)):
			l.append(s[0:i + 1])
		for i in l:
			print('.' * (len(s) - len(i)) + i)


class Solution:

	def printTriangleDownwards(self, s):
		for i in range(len(s)):
			x = '.' * len(s[i + 1:])
			y = s[:i + 1]
			print(x + y)


class Solution:

	def printTriangleDownwards(self, s):
		n = len(s)
		a = []
		for i in range(1, n + 1):
			st = ''
			for j in range(n - i):
				st += '.'
			f = len(st)
			for j in range(n - f):
				st += s[j]
			print(st)


class Solution:

	def printTriangleDownwards(self, s):
		l = ['.'] * len(s)
		for i in range(len(s)):
			l.pop(0)
			l.append(s[i])
			print(''.join(l))


class Solution:

	def printTriangleDownwards(self, s):
		N = len(s)
		for i in range(N):
			for j in range(N - i - 1):
				print('.', end='')
			for k in range(i + 1):
				print(s[k], end='')
			print()


class Solution:

	def printTriangleDownwards(self, s):
		c = ''
		for i in range(1, len(s)):
			c += '.'
		p = len(s)
		s = c + s
		for i in range(p):
			print(s[i:p + i])


class Solution:

	def printTriangleDownwards(self, s):
		i = 0
		n = len(s) - 1
		while i < len(s):
			print('.' * n + s[:i + 1])
			i += 1
			n -= 1


class Solution:

	def printTriangleDownwards(self, s):
		a = len(s)
		for x in range(1, a + 1):
			print('.' * (a - 1) + s[:x])
			a -= 1