Triangle pattern using python
1.Normal triangle
for i in range(1,5):
for j in range(i,4):
print(end=" ")
for k in range(0,(2*i)-1):
print("*",end=" ")
print()
2.Inverted triangle
for i in range(5,0,-1):
for j in range(i,4):
print(end=" ")
for k in range(0,(2*i)-1):
print("*",end=" ")
print()
3.Right angled triangle
for i in range(1,5):
for k in range(0,(2*i)-1):
print("*",end=" ")
print()
No comments: