Skip to content

Commit 4c2b38c

Browse files
Create Zeroes and Stars Pattern.py
1 parent 8a5fc9b commit 4c2b38c

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'''
2+
Problem statement
3+
Print the following pattern
4+
5+
Pattern for N = 4
6+
7+
*000*000*
8+
0*00*00*0
9+
00*0*0*00
10+
000***000
11+
Detailed explanation ( Input/output format, Notes, Images )
12+
Sample Input 1 :
13+
3
14+
Sample Output 1 :
15+
*00*00*
16+
0*0*0*0
17+
00***00
18+
Sample Input 2 :
19+
5
20+
Sample Output 2 :
21+
*0000*0000*
22+
0*000*000*0
23+
00*00*00*00
24+
000*0*0*000
25+
0000***0000
26+
'''
27+
28+
from os import *
29+
from sys import *
30+
from collections import *
31+
from math import *
32+
33+
n = int(input())
34+
35+
for i in range(1, n+1):
36+
for o in range(1, i):
37+
print("0", end="")
38+
print("*", end="")
39+
for o in range(1, n-i+1):
40+
print("0", end="")
41+
print("*", end="")
42+
for o in range(1, n-i+1):
43+
print("0", end="")
44+
print("*", end="")
45+
for o in range(1, i):
46+
print("0", end="")
47+
print()
48+

0 commit comments

Comments
 (0)