We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57aa891 commit e8b785fCopy full SHA for e8b785f
pattern/1_1_1n.py
@@ -0,0 +1,26 @@
1
+n=int(input("enter a number: "))
2
+i=1
3
+while i<=n:
4
+ j=i
5
+ c=0
6
+ k=j
7
+ while j>0:
8
+ print(k," ",sep='',end="")
9
+ k=k+n-1-c
10
+ j-=1
11
+ c+=1
12
+ i+=1
13
+ print()
14
+'''
15
+output:
16
+enter a number: 9
17
+1
18
+2 10
19
+3 11 18
20
+4 12 19 25
21
+5 13 20 26 31
22
+6 14 21 27 32 36
23
+7 15 22 28 33 37 40
24
+8 16 23 29 34 38 41 43
25
+9 17 24 30 35 39 42 44 45
26
0 commit comments