-
Notifications
You must be signed in to change notification settings - Fork 0
/
Class8-Control Flow, Problem Solving-CipherSchools.py
114 lines (102 loc) · 1.81 KB
/
Class8-Control Flow, Problem Solving-CipherSchools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
n=6
for i in range(n):
for j in range(n):
print(i,end=" ")
print()
n=6
for i in range(n):
for j in range(n):
print(i,end=" ")
#print()
...
... n=6
... for i in range(n):
... for j in range(n):
... print(i,end=" ")
... print('\n')
...
... n=6
... for i in range(n):
... for j in range(n):
... print(j,end=" ")
... print()
...
... n=6
... for i in range(n):
... for j in range(n):
... print(max(i,j),end=" ")
... print()
...
...
... n=6
... for i in range(n):
... for j in range(n):
... print(n-i,end=" ")
... print()
...
...
... n=6
... for i in range(n):
... for j in range(n):
... print(n-j,end=" ")
... print()
...
... n=6
... for i in range(n):
... for j in range(n):
... print(max(n-i,n-j),end=" ")
... print()
...
...
... n=6
... for i in range(n):
... for j in range(n):
... print(i+1,end=" ")
... print()
...
...
n=6
for i in range(n):
for j in range(n):
print(j+1,end=" ")
print()
n=6
for i in range(n):
for j in range(n):
print(n-i-1,end=" ")
print()
n=6
for i in range(n):
for j in range(n):
print(n-j-1,end=" ")
print()
n=6
for i in range(n):
for j in range(n):
print(max(n-i-1,n-j-1),end=" ")
print()
#1st method
n=6
for i in range(n):
for j in range(n):
print(max(i+1,j+1,n-i,n-j),end=" ")
print()
#2nd method
n=6
for i in range(n):
for j in range(n):
print(max(max(i+1,j+1),max(n-i-1+1,n-j-1+1)),end=" ")
print()
#write the question for these solution
n=7
for i in range(n):
for j in range(n):
print(max(i+1,j+1,n-i,n-j),end=" ")
print()
n=7
for i in range(n):
for j in range(n):
print((i,j),end=" ")
print()