[Solved] Converting binary code to DNA code [closed]


You could loop over that input in steps of two, detect the binary word and add the corresponding nucleic acid to the output.

inputStr="00011011" # ABCD
outputStr=""

for start in range(0, len(inputStr), 2):
    word = inputStr[start:start+2]
    if word == '00': outputStr += 'A'
    elif word == '01': outputStr += 'B'
    elif word == '10': outputStr += 'C'
    elif word == '11': outputStr += 'D'

1

solved Converting binary code to DNA code [closed]