Depending on the integer input, I need to create a triangle of triangle pattern of *.
For instance:
n = 2
*
***
* * *
*********
n = 3
*
***
*****
* * *
*** *** ***
***************
* * * * *
*** *** *** *** ***
*************************
I've already figured out the code for a single triangle, but I don't know how to duplicate them so they'll appear like a triangle of triangles.
Here's my code for one triangle:
rows = int(input())
for i in range(rows):
for j in range(i, rows):
print(" ", end="")
for j in range(i):
print("*", end="")
for j in range(i + 1):
print("*", end="")
print()