Skip to content

Commit d512ec8

Browse files
committed
pyramid pattern in python
1 parent 53ad5b0 commit d512ec8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Pyramid pattern.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def pattern(n):
2+
k = n - 1
3+
for i in range(0, n):
4+
for j in range(0, k):
5+
print(end=" ")
6+
k = k - 1
7+
for j in range(0, i + 1):
8+
print("* ", end="")
9+
print("\r")
10+
pattern(5)

0 commit comments

Comments
 (0)