Skip to content

Commit a21792a

Browse files
Create Mirror Number Pattern.py
1 parent 396f585 commit a21792a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

06 Patterns2/Mirror Number Pattern.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'''
2+
Problem statement
3+
Print the following pattern for the given N number of rows.
4+
5+
Pattern for N = 4
6+
7+
8+
9+
10+
The dots represent spaces.
11+
12+
13+
14+
Detailed explanation ( Input/output format, Notes, Images )
15+
Constraints
16+
0 <= N <= 50
17+
Sample Input 1:
18+
3
19+
Sample Output 1:
20+
1
21+
12
22+
123
23+
Sample Input 2:
24+
4
25+
Sample Output 2:
26+
1
27+
12
28+
123
29+
1234
30+
'''
31+
32+
## Read input as specified in the question
33+
n = int(input())
34+
## Print the required output in given format
35+
for i in range(1,n+1):
36+
for s in range(1,n-i+1):
37+
print(" ",end="")
38+
for j in range(1,i+1):
39+
print(j, end="")
40+
print()

0 commit comments

Comments
 (0)