回答編集履歴

2

追記

2018/05/16 10:37

投稿

hayataka2049
hayataka2049

スコア30933

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

1

コード見やすく

2018/05/16 10:37

投稿

hayataka2049
hayataka2049

スコア30933

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
+ ```とでもしてあげてください。