> Thank you for the response! I next modified the __str__ so it will also
> include the values self. boredom and self. hunger. I am getting a bit
> confused with how to set up strings from within a method. It is set up like
> this:
>
> def __str__(self):
> attrs = "Hunger: ", self.hunge
> I am trying to use a __str__ method to display the values of attribute mood
> = self.hunger + self. boredom.
> When I try to execute I get this error:
>
> Traceback (most recent call last):
> File "C:/Users/Vincent/Documents/Programming Tutorials/Python Programming
> for the Absolute Beginner -
On Sun, Mar 10, 2013 at 4:57 AM, Vincent Balmori
wrote:
> I am trying to use a __str__ method to display the values of attribute mood
> = self.hunger + self. boredom.
__str__ has to return a string:
http://docs.python.org/3/reference/datamodel.html#object.__str__
Bookmark the "_" index of the d
On 10/03/13 19:57, Vincent Balmori wrote:
I am trying to use a __str__ method to display the values of attribute mood =
self.hunger + self. boredom.
When I try to execute I get this error:
Traceback (most recent call last):
File "C:/Users/Vincent/Documents/Programming Tutorials/Python Progra
Op 10-03-13 09:57, Vincent Balmori schreef:
I am trying to use a __str__ method to display the values of attribute
mood = self.hunger + self. boredom.
When I try to execute I get this error:
Traceback (most recent call last):
File "C:/Users/Vincent/Documents/Programming Tutorials/Python
Prog
I am trying to use a __str__ method to display the values of attribute mood =
self.hunger + self. boredom.
When I try to execute I get this error:
Traceback (most recent call last):
File "C:/Users/Vincent/Documents/Programming Tutorials/Python Programming for
the Absolute Beginner - Project
F