-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest27.py
More file actions
39 lines (34 loc) · 713 Bytes
/
test27.py
File metadata and controls
39 lines (34 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
n=int(input("Enter the number of rows :"))
for i in range (n):
for j in range(n-i-1):
print(end=" ")
for j in range (0,i+1):
print("*",end=" ")
print()
for i in range (n-1,0,-1):
for j in range(0,n-i):
print(end=" ")
for j in range (0,i):
print("*",end=" ")
print()
# Output :
# Enter the number of rows :10
# *
# * *
# * * *
# * * * *
# * * * * *
# * * * * * *
# * * * * * * *
# * * * * * * * *
# * * * * * * * * *
# * * * * * * * * * *
# * * * * * * * * *
# * * * * * * * *
# * * * * * * *
# * * * * * *
# * * * * *
# * * * *
# * * *
# * *
# *