- To print full odd triangle pattern using *
User Input: 3
Output:
* * * * * *
rows=int(input("Enter number of rows : "))
for i in range(rows,0,-1):
for j in range(1,2*rows-i+1):
if(j>=i and (j+i)%2==0):
print("* ", end="")
else:
print(" ", end="")
print("")
Enter number of rows: 4 * * * * * * * * * *Program
Main Logic :
for i in range(rows,0,-1): #rows : number of rows to print
for j in range(1,2*rows-i+1):
if(j>=i and (j+i)%2==0):
print("* ", end="")
else:
print(" ", end="")
print("")
You can print any thing in this pattern, just replace your value with *
Coming Soon !
QuickThe dreams I chased took me on a journey, a journey more rewarding than the goals