質問編集履歴
1
出力結果を追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -33,3 +33,23 @@
|
|
33
33
|
print(data_list[0:n-1])
|
34
34
|
|
35
35
|
```
|
36
|
+
|
37
|
+
出力結果
|
38
|
+
|
39
|
+
---------------------------------------------------------------------------
|
40
|
+
|
41
|
+
IndexError Traceback (most recent call last)
|
42
|
+
|
43
|
+
<ipython-input-8-b66828f06a42> in <module>
|
44
|
+
|
45
|
+
6 data_list[0:n-1].append(x)
|
46
|
+
|
47
|
+
7
|
48
|
+
|
49
|
+
----> 8 random_list[0:n-1][100] = 1
|
50
|
+
|
51
|
+
9 print(data_list[0:n-1])
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
IndexError: list assignment index out of range
|