I apologize if this has been answered, but I've search everywhere and cannot seem to find an answer. Say I have a class Dog. That class has two objects, Buster and Bowser. What would be the best way to create methods specific to each object?
For instance, if I wanted to create roll_over() and play_dead() methods that only Buster can do, and stand() and high_five() methods that only Bowser can do, what would be a good way to do that?
Additionally (this might need to be its own question), how could I give these methods user-readable names so that if they were using Buster, they could see options to make him "Roll over" or "Play dead", and so on for Bowser?
Thank you.
buster = Dog(); def roll_over(self): print "Rolling over!"; buster.roll_over = roll_over(put newlines after the;s). Is that what you're looking for?buster.roll_over = roll_overline works?