Welcome to the Treehouse Community
Looking to learn something new?
python oop with kenneth
am failing to understand oop ,from the first two videos i have watched am totally lost,please helf
class Student: name = "Your Name" def praise(self) : return 'well done'.self def_str_(self): return self.name
Steven Parker215,956 Points
Here's a few hints:
- nothing named "
def_str_" has been defined, and it's not valid definition syntax
- the instructions only ask for a "praise" method, nothing else will be needed
- a string has no "self" attribute
- you can use concatenation ("+" operator) to build up a string using a variable
- the syntax for a concatenated message might look like
'well done ' + self.name