回答編集履歴
2
追記
test
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
setの中に入れられるのはimmutable(というかhashable)なオブジェクトだけです。str.splitlines()の返り値はlistで、listはmutableなオブジェクトなのでそのエラーが出ます。
|
2
2
|
|
3
|
-
|
3
|
+
~~
|
4
4
|
|
5
5
|
tuple(input().splitlines())
|
6
6
|
|
7
|
-
|
7
|
+
とでもしてあげてください。
|
8
|
+
|
9
|
+
~~
|
10
|
+
|
11
|
+
### 追記
|
12
|
+
|
13
|
+
inputは改行されるまで読み込む関数なので、.splitlines()は不要です。
|
14
|
+
|
15
|
+
mkgreiさんの方法で良いと思います。
|
1
コード見やすく
test
CHANGED
@@ -1,3 +1,7 @@
|
|
1
1
|
setの中に入れられるのはimmutable(というかhashable)なオブジェクトだけです。str.splitlines()の返り値はlistで、listはmutableなオブジェクトなのでそのエラーが出ます。
|
2
2
|
|
3
|
+
```python
|
4
|
+
|
3
|
-
tuple(input().splitlines())
|
5
|
+
tuple(input().splitlines())
|
6
|
+
|
7
|
+
```とでもしてあげてください。
|