File tree 8 files changed +38
-38
lines changed
8 files changed +38
-38
lines changed Original file line number Diff line number Diff line change 11
11
while i <= N :
12
12
j = 1
13
13
while j <= i :
14
- print (chr (65 + i - 1 ), end = '' )
14
+ ch = chr (ord ('A' )+ i - 1 )
15
+ print (ch , end = '' )
15
16
j = j + 1
16
17
print ()
17
18
i = i + 1
Original file line number Diff line number Diff line change 11
11
j = 1
12
12
k = i
13
13
while j <= i :
14
- print (chr (65 + k - 1 ), end = '' )
14
+ ch = chr (ord ('A' )+ k - 1 )
15
+ print (ch , end = '' )
15
16
k = k + 1
16
17
j = j + 1
17
18
print ()
Original file line number Diff line number Diff line change 12
12
j = 1
13
13
k = i
14
14
while j <= i :
15
- print (chr (65 + N - k ), end = '' )
15
+ ch = chr (ord ('A' )+ N - k )
16
+ print (ch , end = '' )
16
17
k = k - 1
17
18
j = j + 1
18
19
print ()
19
- i = i + 1
20
+ i = i + 1
Original file line number Diff line number Diff line change 6
6
# 1
7
7
8
8
N = int (input ())
9
- i = N
10
- while i >= 1 :
9
+ i = 1
10
+ while i <= N :
11
11
j = 1
12
- while j <= i :
12
+ while j <= N - i + 1 :
13
13
print (j , end = '' )
14
14
j = j + 1
15
15
print ()
16
- i = i - 1
16
+ i = i + 1
Original file line number Diff line number Diff line change 8
8
N = int (input ())
9
9
i = 1
10
10
while 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
15
15
print ()
16
16
i = i + 1
Original file line number Diff line number Diff line change 12
12
13
13
n = int (input ())
14
14
i = 1
15
- c = int (n / 2 ) + 1
16
- while i <= c :
15
+ inc = int (n / 2 ) + 1
16
+ while i <= inc :
17
17
sp = 1
18
- while sp < 2 * i - 2 :
18
+ while sp < i :
19
19
print (' ' , end = '' )
20
20
sp = sp + 1
21
21
j = 1
22
22
while j <= i :
23
23
print ('* ' , end = '' )
24
- j = j + 1
24
+ j = j + 1
25
25
print ()
26
26
i = i + 1
27
27
i = 1
28
- d = n - c
29
- while i <= n - c :
28
+ dec = n - inc
29
+ while i <= n - inc :
30
30
sp = 1
31
- while sp < d :
31
+ while sp < dec :
32
32
print (' ' , end = '' )
33
33
sp = sp + 1
34
34
j = 1
35
- while j <= d :
35
+ while j <= dec :
36
36
print ('* ' , end = '' )
37
37
j = j + 1
38
38
print ()
39
39
i = i + 1
40
- d = d - 1
40
+ dec = dec - 1
Original file line number Diff line number Diff line change 9
9
10
10
n = int (input ())
11
11
i = 1
12
- s = (n + 1 )/ 2
13
- while i <= s :
12
+ s1 = (n + 1 )/ 2
13
+ while i <= s1 :
14
14
sp = 1
15
- while sp <= s - i :
15
+ while sp <= s1 - i :
16
16
print (' ' , end = '' )
17
17
sp = sp + 1
18
18
j = 1
19
19
while j <= 2 * i - 1 :
20
- print ("*" , end = '' )
20
+ print ('*' , end = '' )
21
21
j = j + 1
22
22
print ()
23
23
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 :
29
30
print (' ' , end = '' )
30
- j = j + 1
31
+ sp += 1
31
32
k = 1
32
- while k <= 2 * i - 1 :
33
+ while k <= n - 2 * i :
33
34
print ("*" , end = '' )
34
35
k = k + 1
35
36
print ()
36
- i = i - 1
37
+ i = i + 1
Original file line number Diff line number Diff line change 13
13
print (' ' , end = '' )
14
14
sp = sp + 1
15
15
j = 1
16
- while j <= i :
16
+ while j <= 2 * i - 1 :
17
17
print ('*' , end = '' )
18
18
j = j + 1
19
- k = i - 1
20
- while k >= 1 :
21
- print ('*' , end = '' )
22
- k = k - 1
23
19
print ()
24
20
i = i + 1
You can’t perform that action at this time.
0 commit comments