Mar-29-2023, 01:15 PM
You have spaces in the key values, so when you are searching for
I think that your
B
, the key that you're looking for is in fact B
.I think that your
TrialSystem():
needs to be:def TrialSystem(): hmm = {} hmm[0] = ({'A': 0.3, 'B': 0.2, 'C': 0.5}, 1) hmm[1] = ({'A': 0.1, 'B': 0.8, 'C': 0.1}, 2) hmm[2] = ({'A': 0.4, 'B': 0.6}, -1) return hmmHow hope this is of help.
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein