this is my dictionary:
weights = {
71.03711 : "A",
156.10111 : "R",
114.04293 : "N",
115.02694 : "D",
103.00919 : "C",
129.04259 : "E",
128.05858 : "Q",
57.02146 : "G",
137.05891 : "H",
113.08406 : "I",
128.09496 : "K",
131.04049 : "M",
147.06841 : "F",
97.05276 : "P",
87.03203 : "S",
101.04768 : "T",
186.07931 : "W",
163.06333 : "Y",
99.06841 : "V",
}
Now I make a calculation:
a = (129.08346 - 15.99940) # a = 113.08406 = "I" (in dictionary)
Then:
sequence += weights[a]
ERROR:
Traceback (most recent call last):
File "task2.py", line 43, in <module>
sequence += weights[a]
KeyError: 113.08406000000001
Why does he attach that 1 ? :( I need the value 113.08406 !