回答編集履歴
2
修正
answer
CHANGED
@@ -16,10 +16,10 @@
|
|
16
16
|
with open(output_path, "w") as f:
|
17
17
|
for line in text.splitlines():
|
18
18
|
if line.startswith(">"):
|
19
|
-
# > で始まる行はそのまま
|
19
|
+
# > で始まる行はそのまま出力
|
20
20
|
f.write(line + "\n")
|
21
21
|
else:
|
22
|
-
# それ以外の行は指定範囲を
|
22
|
+
# それ以外の行は指定範囲を出力
|
23
23
|
f.write(line[slice_range] + "\n")
|
24
24
|
```
|
25
25
|
|
1
修正
answer
CHANGED
@@ -16,8 +16,10 @@
|
|
16
16
|
with open(output_path, "w") as f:
|
17
17
|
for line in text.splitlines():
|
18
18
|
if line.startswith(">"):
|
19
|
+
# > で始まる行はそのまま抽出
|
19
20
|
f.write(line + "\n")
|
20
21
|
else:
|
22
|
+
# それ以外の行は指定範囲を抽出
|
21
23
|
f.write(line[slice_range] + "\n")
|
22
24
|
```
|
23
25
|
|