I\'m teaching a Python class on object-oriented programming and as I\'m brushing up on how to explain classes, I saw an empty class definition:
class Employe
Try with lambda:
john.greet = lambda : print( 'hello world!' )
The you'll be able to do:
john.greet()
EDIT: Thanks Thomas K for the note - this works on Python 3.2 and not for Python2, where print appeared to be statement. But this will work for lambdas, without statements (right? Sorry, I know only python3.2 (: )