質問編集履歴

2

修正

2017/10/15 17:06

投稿

yoyoyo0205
yoyoyo0205

スコア20

test CHANGED
File without changes
test CHANGED
@@ -16,11 +16,11 @@
16
16
 
17
17
  File "~/count1.py", line 23, in <module>
18
18
 
19
- text.extend(i[len(["tags"])])
19
+ text.extend(len(i["tags"]))
20
20
 
21
21
 
22
22
 
23
- KeyError: 1
23
+ TypeError: 'int' object is not iterable
24
24
 
25
25
  ```
26
26
 
@@ -72,7 +72,7 @@
72
72
 
73
73
  for i in data:
74
74
 
75
- text.extend(i[len(["tags"])])
75
+ text.extend(len(i["tags"]))
76
76
 
77
77
 
78
78
 
@@ -85,23 +85,3 @@
85
85
 
86
86
 
87
87
  ```
88
-
89
-
90
-
91
- ###試したこと
92
-
93
- ```
94
-
95
- text.extend(i[len(["tags"])])
96
-
97
- の部分を、
98
-
99
- text.extend(len(i["tags"]))
100
-
101
- とすると、
102
-
103
- TypeError: 'int' object is not iterable
104
-
105
- とエラーがでます。
106
-
107
- ```

1

補足

2017/10/15 17:05

投稿

yoyoyo0205
yoyoyo0205

スコア20

test CHANGED
File without changes
test CHANGED
@@ -82,4 +82,26 @@
82
82
 
83
83
  nt.writelines(txt+"\n")
84
84
 
85
+
86
+
85
87
  ```
88
+
89
+
90
+
91
+ ###試したこと
92
+
93
+ ```
94
+
95
+ text.extend(i[len(["tags"])])
96
+
97
+ の部分を、
98
+
99
+ text.extend(len(i["tags"]))
100
+
101
+ とすると、
102
+
103
+ TypeError: 'int' object is not iterable
104
+
105
+ とエラーがでます。
106
+
107
+ ```