Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 8 Online
OpenStudy (anonymous):

Im on ps12 and Im not sure if Im doing the doesClear function inside the simplePatient class. This is my code: http://dpaste.com/hold/591287/ Im trying to figure out if it is dependent upon self.clearProb (if it is then Im not doing this right...) Any of you course "graduates" there to help out? (dont mind the other stuff for now)

OpenStudy (anonymous):

ok you are doing that wrong, and your right in guessing that it is dependant on self.clearProb. you need something like random.random() (returns a float between 0 and 1) to produce a random number to compare to your clearProb and muteProb too, from there you just do a simple: random.random() <cmp> self.clearProb: return <Boolean>

OpenStudy (anonymous):

oooooh ok thanks~! that had me stumped for a little bit. I also had misread the problem and thought i had to use random.randint() not random.random(). thanks. I think Im having further issues with my mutation portion of resistant virus (its not in the above code). I'll post another Q tomorrow If I cant work it out tonight)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!