Skip to content

Commit ccd2c21

Browse files
Create 1_1_3n_4.py
1 parent 5d73b5e commit ccd2c21

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pattern/1_1_3n_4.py

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

0 commit comments

Comments
 (0)