Решено. Квиз не принят. Непонятно
EXERCISE BREAK: Give all values of Skewi (GAGCCACCGCGATA) for i ranging from 0 to 14.
Sample Input:
CATGGGCATCGGCCATACGCC
CATGGGCATCGGCCATACGCC
Sample Output:
0 -1 -1 -1 0 1 2 1 1 1 0 1 2 1 0 0 0 0 -1 0 -1 -2
0 -1 -1 -1 0 1 2 1 1 1 0 1 2 1 0 0 0 0 -1 0 -1 -2
def skew(Genome):
skew_i = 0
skew_diagram = []
for i in Genome:
if i == "C":
skew_i -=1
skew_diagram.append(str(skew_i))
elif i == "G":
skew_i +=1
skew_diagram.append(str(skew_i))
else:
skew_diagram.append(str(skew_i))
return ' '.join(skew_diagram)
print (skew("GAGCCACCGCGATA"))
Немає коментарів:
Дописати коментар