Changes
From Biolecture.org
Created page with "<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202017-12-12%2021-33-53-945.jpg" style="height:252px; width:639px" /></p> <p>f = open('rosalind_ba1m.txt','r&..."
<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202017-12-12%2021-33-53-945.jpg" style="height:252px; width:639px" /></p>
<p>f = open('rosalind_ba1m.txt','r')<br />
ind = int(f.readline())<br />
k = int(f.readline())<br />
f.close</p>
<p>a = []<br />
for i in range(0,k):<br />
d = 4**(k-i-1)<br />
count = 0<br />
if d > ind:<br />
a.append('A')<br />
else:<br />
while(d<=ind):<br />
ind -= d<br />
count += 1<br />
if count==1:<br />
a.append('C')<br />
if count==2:<br />
a.append('G')<br />
if count==3:<br />
a.append('T')<br />
print("".join(a))</p>
<p>f = open('rosalind_ba1m.txt','r')<br />
ind = int(f.readline())<br />
k = int(f.readline())<br />
f.close</p>
<p>a = []<br />
for i in range(0,k):<br />
d = 4**(k-i-1)<br />
count = 0<br />
if d > ind:<br />
a.append('A')<br />
else:<br />
while(d<=ind):<br />
ind -= d<br />
count += 1<br />
if count==1:<br />
a.append('C')<br />
if count==2:<br />
a.append('G')<br />
if count==3:<br />
a.append('T')<br />
print("".join(a))</p>