Some problems with classes
ssecorp
circularfunc at gmail.com
Sun Aug 31 22:43:01 EDT 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