Some problems with classes

ssecorp circularfunc at gmail.com
Mon Sep 1 04:43:01 CEST 2008


class Animal(object):
    def __init__(self, name, weight):
        self.name = name
        self.weight = weight

    def speak(self):
        print "speak"

class Vegetable(object):
    def __init__(self, name, volume):
        self.name = name
        self.volume = volume

    def split(self):
        print "tjoff"

class Vegan(Animal, Vegetable):
    def __init__(self, name, attacks):
        self.name = name
        self.attacks = attacks



More information about the Python-list mailing list