[Tutor] Why None?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue Feb 7 21:57:58 CET 2006



On Tue, 7 Feb 2006, Christopher Spears wrote:

> I get it!  Have printFood return a string!
>
> def printFood(self):
> 		return self.food.foodName

Yup.  *grin*

Do one more thing though: call the function something other than
'printFood' now, since it clearly isn't doing any printing itself.
'getFoodName' is a bit pedestrian, but it might work as a name.

Good luck!



More information about the Tutor mailing list