Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- def main():
- inputString = sys.argv[2]
- numPrior = len(inputString)
- resultFile = open("result.txt", 'w+')
- if not inputString:
- resultFile.write("Observation sequence Q: NULL")
- resultFile.write("Length of Q: 0")
- else:
- resultFile.write("Observation sequence Q: " + inputString)
- resultFile.write("Length of Q: " + str(numPrior))
- if not inputString:
- resultFile.write("After No Observations: ")
- resultFile.write("")
- resultFile.write("P(h1 | Q) = .1")
- resultFile.write("P(h2 | Q) = .2")
- resultFile.write("P(h3 | Q) = .4")
- resultFile.write("P(h4 | Q) = .2")
- resultFile.write("P(h5 | Q) = .1")
- resultFile.write("")
- resultFile.write("Probability that the next candy we pick will be C, given Q: .5")
- resultFile.write("Probability that the next candy we pick will be L, given Q: .5")
- else:
- for x in inputString:
- print(x)
- resultFile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement