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

質問編集履歴

1

追記

2018/12/02 06:18

投稿

22Go
22Go

スコア55

title CHANGED
File without changes
body CHANGED
@@ -1,15 +1,16 @@
1
1
  ```python
2
2
  with open("short.sequ.txt") as f:
3
- ....for line in f:
3
+ for line in f:
4
- ........if line.startswith(">"):
4
+ if line.startswith(">"):
5
- ...........print(line)
5
+ print(line)
6
- ...........seq = ""
6
+ seq = ""
7
- ........else:
7
+ else:
8
- ...........seq += "".join(line.split())
8
+ seq += "".join(line.split())
9
- ...........count = [len(seq)]
9
+ count = [len(seq)]
10
- ...........print(count)
10
+ print(count)
11
11
  ```
12
+ ```
12
- ```short.sequ.txt
13
+ short.sequ.txt
13
14
  >YP_009518834.1 putative uncharacterized protein YjiT [Escherichia coli str. K-12 substr. MG1655]
14
15
  MGQSEYISWVKCTSWLSNFVNLRGLRQPDGRPLYEYHATNDEYTQLTQLLRAVGQSQSNICNRDFAACFV
15
16
  LFCSEWYRRDYERQCGWTWDPIYKKIGISFTATELGTIVPKGMEDYWLRPIRFYESERRNFLGTLFSEGG