Open main menu

Biolecture.org β

Minsu Kim/python/Rosalind / problem11

Revision as of 21:47, 12 December 2017 by imported>Minsukim (Created page with "<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202017-12-12%2021-44-18-259.jpg" style="height:257px; width:725px" /></p> <p>This problem is so similar to previous probl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This problem is so similar to previous problem (10)

f = open('rosalind_ba1m.txt','r')
ind = int(f.readline())
k = int(f.readline())
f.close

a = []
for i in range(0,k):
    d = 4**(k-i-1)
    count = 0
    if d > ind:
        a.append('A')
    else:
        while(d<=ind):
            ind -= d
            count += 1
        if count==1:
            a.append('C')
        if count==2:
            a.append('G')
        if count==3:
            a.append('T')
print("".join(a))