質問編集履歴

3

エラー内容修正いたしました

2019/03/06 07:34

投稿

Yoichinn
Yoichinn

スコア16

test CHANGED
File without changes
test CHANGED
@@ -60,17 +60,17 @@
60
60
 
61
61
  for i in list:
62
62
 
63
- if type(ph + str(No)) != 'list':
63
+ if type(ph + str(No)) != 'list':
64
64
 
65
65
  ph + str(No) = [] #←こんな感じでリストを作れないでしょうか?
66
66
 
67
67
 
68
68
 
69
- (ph + str(No)).append('aaa')
69
+ (ph + str(No)).append('aaa')
70
70
 
71
- if len(ph + str(No)) > 3:
71
+ if len(ph + str(No)) > 10:
72
72
 
73
- No = No + 1
73
+ No = No + 1
74
74
 
75
75
  ```
76
76
 
@@ -88,6 +88,4 @@
88
88
 
89
89
  ・・
90
90
 
91
- ^
92
-
93
- IndentationError: expected an indented block
91
+ SyntaxError: can't assign to operator

2

※コードのコピペにミスがありましたので修正いたしました

2019/03/06 07:34

投稿

Yoichinn
Yoichinn

スコア16

test CHANGED
File without changes
test CHANGED
@@ -46,6 +46,8 @@
46
46
 
47
47
 
48
48
 
49
+
50
+
49
51
  list = ['a', 'b', 'c', 'd','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
50
52
 
51
53
 
@@ -58,17 +60,15 @@
58
60
 
59
61
  for i in list:
60
62
 
61
- if type(list + str(No)) != 'list':
63
+ if type(ph + str(No)) != 'list':
62
64
 
63
- list + str(No) = [] #←こんな感じでリストを作れないでしょうか?(ここでインデントエラー)
65
+ ph + str(No) = [] #←こんな感じでリストを作れないでしょうか?
64
66
 
65
67
 
66
68
 
67
- (list + str(No)).append('aaa') #リストにデータ追加
69
+ (ph + str(No)).append('aaa')
68
70
 
69
-
70
-
71
- if len(list + str(No)) > 10:
71
+ if len(ph + str(No)) > 3:
72
72
 
73
73
  No = No + 1
74
74
 
@@ -82,10 +82,12 @@
82
82
 
83
83
  エラーメッセージ
84
84
 
85
- File "test_list.py", line 8
85
+ File "test_list.py", line 12
86
86
 
87
- (list + str(No)) = []
87
+ ph + str(No) = [] #竊舌%繧薙↑諢溘§縺ァ繝ェ繧ケ繝医r菴懊l縺ェ縺・〒縺励g縺・°
88
88
 
89
+ ・・
90
+
89
- ^
91
+ ^
90
92
 
91
93
  IndentationError: expected an indented block

1

※エラーメッセージ追記・一部コード記載ミスがありましたので修正いたしました。(ph→list)

2019/03/06 07:20

投稿

Yoichinn
Yoichinn

スコア16

test CHANGED
File without changes
test CHANGED
@@ -60,7 +60,7 @@
60
60
 
61
61
  if type(list + str(No)) != 'list':
62
62
 
63
- ph + str(No) = [] #←こんな感じでリストを作れないでしょうか?(ここでインデントエラー)
63
+ list + str(No) = [] #←こんな感じでリストを作れないでしょうか?(ここでインデントエラー)
64
64
 
65
65
 
66
66
 
@@ -73,3 +73,19 @@
73
73
  No = No + 1
74
74
 
75
75
  ```
76
+
77
+ ※一部コードに記載ミスがありましたので修正いたしました
78
+
79
+
80
+
81
+ <追記>
82
+
83
+ エラーメッセージ
84
+
85
+ File "test_list.py", line 8
86
+
87
+ (list + str(No)) = []
88
+
89
+ ^
90
+
91
+ IndentationError: expected an indented block