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

ps10 prob 4: the class Hand assigns a var self.initialSize. I want to use this variable in my class ComputerPlayer but I am not sure of the syntax on how to access it.

OpenStudy (anonymous):

Hand.initialSize http://pastebin.com/QiX6Z9BC like that?

OpenStudy (anonymous):

That gives the following error message File "C:\Python27\ps10 prob 4", line 254, in pickBestWord n=Hand.initialSize AttributeError: type object 'Hand' has no attribute 'initialSize'

OpenStudy (anonymous):

well.. we can't really know how you are trying to use it unless you post your code or even just a simplified version showing what you are trying to do. have you read section nine of the tutorial? http://docs.python.org/tutorial/classes.html

OpenStudy (espex):

Well that error indicates that the class "Hand" does not have an "initialSize" variable, therefore you cannot assign it a value since it does not exist.

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!