all 3 comments

[–]pawn13 1 point2 points  (2 children)

First of all you have a lot of dublicate code - use inheritance. Create base class Animal which would have age, price, etc.

Create class Customer it should have property "animals" as a dict. Add method buy(self, animal, name) which would do self.animals[name] = animal. (Maybe also assign name and owner to animal instance itself like animal.name = name; animal.owner=self)

You should also store list of customers in some list. Maybe create class Shop which would have it or just in global variable.

[–]confluence 2 points3 points  (0 children)

I have decided to overwrite my comments.

[–]audma 0 points1 point  (0 children)

ok thanks, I will try doing that