im still on ps12 #4. I made some modifications but Im not getting the right answer..... can anybody help me spot the 'bug'? http://dpaste.com/hold/592934/
what kind of output are you getting?
I'm getting numbers beyond maxPop in my graph, but i thought I was preventing this with lines 491-492..
On line 481, popDen is probably always 0. On line 537 you forgot to actually call update.
On line 334 you forgot the self. to call the method getResistance
As an aside, avoid using from module import * Always import exactly what you need/want so as not to clutter your name space.
hey polpak! thanks for replying! I finally discovered the core cause of why my output was wrong: in my for loop on lines 546, 547, I had forgotten to increment mutationVariable(line 545) by one each time through the loop and was not getting the mean value of the resistant viruses I had. Oh and I did catch most of the other stuff as I went through and tested/debugged my code except my forgetting to call update in line 537 ( i couldn't figure out why my graph was flat lining after 150... ). Thanks a Ton! I still remember when you helped me with the primes problem....haha
It's been a while =) I've mostly been helping out over in Mathematics. But I still pop by here now and then.
also, what do you mean by importing exactly what I need? Do you mean something like from math import sqrt ?
yes exactly. import * is bad because any variable or function or whatever that is in the module suddenly becomes part of your module.
Oh ok. I'll try to do that from now on :)
Join our real-time social learning platform and learn together with your friends!