File tree Expand file tree Collapse file tree 8 files changed +38
-38
lines changed Expand file tree Collapse file tree 8 files changed +38
-38
lines changed Original file line number Diff line number Diff line change 1111while i <= N :
1212 j = 1
1313 while j <= i :
14- print (chr (65 + i - 1 ), end = '' )
14+ ch = chr (ord ('A' )+ i - 1 )
15+ print (ch , end = '' )
1516 j = j + 1
1617 print ()
1718 i = i + 1
Original file line number Diff line number Diff line change 1111 j = 1
1212 k = i
1313 while j <= i :
14- print (chr (65 + k - 1 ), end = '' )
14+ ch = chr (ord ('A' )+ k - 1 )
15+ print (ch , end = '' )
1516 k = k + 1
1617 j = j + 1
1718 print ()
Original file line number Diff line number Diff line change 1212 j = 1
1313 k = i
1414 while j <= i :
15- print (chr (65 + N - k ), end = '' )
15+ ch = chr (ord ('A' )+ N - k )
16+ print (ch , end = '' )
1617 k = k - 1
1718 j = j + 1
1819 print ()
19- i = i + 1
20+ i = i + 1
Original file line number Diff line number Diff line change 66# 1
77
88N = int (input ())
9- i = N
10- while i >= 1 :
9+ i = 1
10+ while i <= N :
1111 j = 1
12- while j <= i :
12+ while j <= N - i + 1 :
1313 print (j , end = '' )
1414 j = j + 1
1515 print ()
16- i = i - 1
16+ i = i + 1
Original file line number Diff line number Diff line change 88N = int (input ())
99i = 1
1010while i <= N :
11- j = i
12- while j >= 1 :
13- print (j , end = '' )
14- j = j - 1
11+ j = 1
12+ while j <= i :
13+ print (i - j + 1 , end = '' )
14+ j = j + 1
1515 print ()
1616 i = i + 1
Original file line number Diff line number Diff line change 1212
1313n = int (input ())
1414i = 1
15- c = int (n / 2 ) + 1
16- while i <= c :
15+ inc = int (n / 2 ) + 1
16+ while i <= inc :
1717 sp = 1
18- while sp < 2 * i - 2 :
18+ while sp < i :
1919 print (' ' , end = '' )
2020 sp = sp + 1
2121 j = 1
2222 while j <= i :
2323 print ('* ' , end = '' )
24- j = j + 1
24+ j = j + 1
2525 print ()
2626 i = i + 1
2727i = 1
28- d = n - c
29- while i <= n - c :
28+ dec = n - inc
29+ while i <= n - inc :
3030 sp = 1
31- while sp < d :
31+ while sp < dec :
3232 print (' ' , end = '' )
3333 sp = sp + 1
3434 j = 1
35- while j <= d :
35+ while j <= dec :
3636 print ('* ' , end = '' )
3737 j = j + 1
3838 print ()
3939 i = i + 1
40- d = d - 1
40+ dec = dec - 1
Original file line number Diff line number Diff line change 99
1010n = int (input ())
1111i = 1
12- s = (n + 1 )/ 2
13- while i <= s :
12+ s1 = (n + 1 )/ 2
13+ while i <= s1 :
1414 sp = 1
15- while sp <= s - i :
15+ while sp <= s1 - i :
1616 print (' ' , end = '' )
1717 sp = sp + 1
1818 j = 1
1919 while j <= 2 * i - 1 :
20- print ("*" , end = '' )
20+ print ('*' , end = '' )
2121 j = j + 1
2222 print ()
2323 i = i + 1
24- i = s - 1
25- m = i
26- while i >= 1 :
27- j = 1
28- while j <= m - i + 1 :
24+
25+ i = 1
26+ s2 = n - s1
27+ while i <= s2 :
28+ sp = 1
29+ while sp <= i :
2930 print (' ' , end = '' )
30- j = j + 1
31+ sp += 1
3132 k = 1
32- while k <= 2 * i - 1 :
33+ while k <= n - 2 * i :
3334 print ("*" , end = '' )
3435 k = k + 1
3536 print ()
36- i = i - 1
37+ i = i + 1
Original file line number Diff line number Diff line change 1313 print (' ' , end = '' )
1414 sp = sp + 1
1515 j = 1
16- while j <= i :
16+ while j <= 2 * i - 1 :
1717 print ('*' , end = '' )
1818 j = j + 1
19- k = i - 1
20- while k >= 1 :
21- print ('*' , end = '' )
22- k = k - 1
2319 print ()
2420 i = i + 1
You can’t perform that action at this time.
0 commit comments