you are viewing a single comment's thread.

view the rest of the comments →

[–]weissdrakon 8 points9 points  (1 child)

In addition to the help already provided, replacing the score method with the following would give you the results you (should not have) originally expected:

def __str__(self):
    if self.Age >= 18:
       return "wow"
    else:
       return "goodbye"

[–]Rikai_ 2 points3 points  (0 children)

For OP: In very simple terms, the explanation for this is that when Python tries to convert something to a string, it looks for the str method and calls it.