回答編集履歴
1
変数名を変更
test
CHANGED
@@ -6,25 +6,25 @@
|
|
6
6
|
|
7
7
|
```python
|
8
8
|
|
9
|
-
def replace(data,
|
9
|
+
def replace(data, rep, i = 1):
|
10
10
|
|
11
|
-
if isinstance(
|
11
|
+
if isinstance(rep[0], list):
|
12
12
|
|
13
|
-
for
|
13
|
+
for n in rep:
|
14
14
|
|
15
|
-
replace(data,
|
15
|
+
replace(data, n, i)
|
16
16
|
|
17
|
-
|
17
|
+
i += 1
|
18
18
|
|
19
19
|
else:
|
20
20
|
|
21
|
-
|
21
|
+
j = 0
|
22
22
|
|
23
|
-
for
|
23
|
+
for n in rep:
|
24
24
|
|
25
|
-
data[
|
25
|
+
data[i][j] = n
|
26
26
|
|
27
|
-
|
27
|
+
j += 1
|
28
28
|
|
29
29
|
|
30
30
|
|