Skip to content

Commit 5e4a5ee

Browse files
authored
Add files via upload
1 parent f56b15a commit 5e4a5ee

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

star.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Star Pattern
2+
3+
n = int(input("Enter Number Of Rows: "))
4+
col = n+n-5
5+
mid = col//2
6+
7+
for i in range(n):
8+
for j in range(col):
9+
10+
if i == 2 or i == (n - 3) or i + j == mid or j - i == mid or i - j == 2 or i + j == col + 1:
11+
print("*", end=" ")
12+
13+
else:
14+
print(" ", end=" ")
15+
16+
print()

0 commit comments

Comments
 (0)