Skip to content

Commit b5bbeee

Browse files
authored
arrow pattern
1 parent 7b022e8 commit b5bbeee

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Arrow pattern

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
n=int(input())
2+
i=1
3+
while i<=n//2:
4+
for spaces in range (1,i):
5+
print(" ",end="")
6+
for j in range (1,i+1):
7+
print("*",end=" ")
8+
print()
9+
i+=1
10+
k=n//2+1
11+
while k>=1:
12+
13+
for spaces in range (1,k):
14+
print(" ",end="")
15+
16+
for j in range (1,k+1):
17+
print("*",end=" ")
18+
print()
19+
k-=1
20+
21+
22+

0 commit comments

Comments
 (0)