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

I've encountered a problem while solving PS#8 with simulation of virus population growth including resistances. When implementing "isResistanTo" fucntion I got an error: TypeError: "instancemethod" object is not iterable. The same error occurs in the solutions to PS#8 posted on the OCW Course site. Any suggestions?

OpenStudy (anonymous):

Make sure your iterators in foreach loops are what you expect them to be

OpenStudy (anonymous):

It would be nice to see your code for a more exact answer, but it seems like, as mentioned above, that you were trying to iterate over an instance method, so your code probably contains something like this: for e in virus1.isResistantTo: # do x y It's possible you just missed the brackets and the arguments to the method.

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!
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!