Open main menu

Biolecture.org β

Minsu Kim/python/Rosalind / problem1

Revision as of 19:47, 12 December 2017 by imported>Minsukim (Created page with "<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202017-12-12%2019-43-06-587.jpg" style="height:411px; width:958px" /></p> <p> </p> <pre> f = open('rosalind_ba1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

 

f = open('rosalind_ba1b.txt','r')
a = []
for line in f_fa:
    i = line.split()
    a.append(i[0])
text = a[0]
f.close()

freq = 11
b = dict()
max_freq = 0
for j in range(0,len(text)-freq+1):
    k = text[j:j+freq]
    if not k in b:
        b[k] = 0
    b[k] += 1
    if max_freq < b[k]:
        max_freq = b[k]
    
for k in b.keys():
    if b[k] == max_freq:
        print(k)