bin_dict = {
'A':'10000000000000000000',
'C':'01000000000000000000',
'D':'00100000000000000000',
'E':'00010000000000000000',
'F':'00001000000000000000',
'G':'00000100000000000000',
'H':'00000010000000000000',
'I':'00000001000000000000',
'K':'00000000100000000000',
'L':'00000000010000000000',
'M':'00000000001000000000',
'N':'00000000000100000000',
'P':'00000000000010000000',
'Q':'00000000000001000000',
'R':'00000000000000100000',
'S':'00000000000000010000',
'T':'00000000000000001000',
'V':'00000000000000000100',
'W':'00000000000000000010',
'Y':'00000000000000000001'
}
seq1="ACDE"
bin_string=''
svm_string=''
for letter in seq:
code = bin_dict[letter]
print code
这段代码的输出是这样的
10000000000000000000
01000000000000000000
00100000000000000000
00010000000000000000
我的第一个问题已经解决了,我以所需的方式得到了输出,AS @goncalopp 建议我尝试重新引入我的 Qtn 以便更好地理解。
Fig 1.
第一步:Seq = ACDE
第二步:通过这个二进制代码 int "1" 的位置将计算如下
10000000000000000000010000000000000000000010000000000000000000010000000000000000
| | | |
1:1 1:22 1:42 1:58
第三步:计算仓位
1:1 1:22 1:42 1:58
第四步:
Ultimate output should be a text file having code only 1:1 1:22 1:42 1:58 to represent the string ACDE
现在请建议我为此的python代码是什么。