Skip to content

Commit eb95774

Browse files
committed
update program 19
1 parent 9ca48ac commit eb95774

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

005-day/Program19.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#print pattens samples
2+
row_count = int(input("How many row required? "))
3+
4+
print("TRIANGLE")
5+
for i in range(1, row_count+1):
6+
str = ""
7+
for j in range(1, i+1):
8+
str += " * "
9+
print(str)
10+
11+
print("PYRAMID")
12+
double_count = row_count*2
13+
for i in range(0, row_count+1):
14+
str = ""
15+
for j in range(0, double_count):
16+
if j > int(double_count/2) - i and j < int(double_count/2) + i:
17+
str += "*"
18+
else:
19+
str += " "
20+
print(str)

0 commit comments

Comments
 (0)