teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2020/07/13 12:11

投稿

tiitoi
tiitoi

スコア21960

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

修正

2020/07/13 12:11

投稿

tiitoi
tiitoi

スコア21960

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