Skip to content

Commit 89a9341

Browse files
Create K_sign.py
1 parent 1ee00f8 commit 89a9341

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pattern/K_sign.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
n=int(input('enter a number: '))
2+
j=1
3+
for i in range(1,n+1):
4+
print('*',sep='',end="")
5+
if i<(n//2+1):
6+
print(' '*(n//2-i+2),sep='',end="")
7+
print('* ',sep='',end="")
8+
else:
9+
print(' '*j,sep='',end="")
10+
print('* ',sep='',end="")
11+
j+=1
12+
print()
13+
'''
14+
output:
15+
enter a number: 9
16+
* *
17+
* *
18+
* *
19+
* *
20+
* *
21+
* *
22+
* *
23+
* *
24+
* *
25+
'''

0 commit comments

Comments
 (0)