8000 Pyramid Pattern Python · hp2107/programminginpython.com@fcafa18 · GitHub
[go: up one dir, main page]

Skip to content

Commit fcafa18

Browse files
committed
Pyramid Pattern Python
1 parent 609441d commit fcafa18

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

patterns/PyramidPattern.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
__author__ = 'Avinash'
2+
3+
# Print a Triangle
4+
5+
# Range of the triangle
6+
num = int(input("Enter the range: \t "))
7+
8+
# i loop for range(height) of the triangle
9+
# first j loop for printing space ' '
10+
# second j loop for printing stars '*'
11+
for i in range(num):
12+
for j in range((num - i) - 1):
13+
print(end=" ")
14+
for j in range(i + 1):
15+
print("*", end=" ")
16+
print()

0 commit comments

Comments
 (0)
0