I am working with 2 classes defined as zone
and system
. The system
is supposed to contain several zones, but the number can vary. So, I have defined for example the class zone
as such:
class zone(object):
def __init__ (self,
nameZone = None,
height = None,
width = None):
self.nameZone = nameZone
self.height = height
self.width = width
and the class system
as follows:
class system(object):
def __init__(self,
SystemName = None,
NumberOfZones = None,
zone = None):
self.SystemName = SystemName
self.NumberOfZones = NumberOfZones
self.zone = zone
So for example I would like to know how do I go about defining the class SYSTEM with a variable number of parameters? Like for example I could have:
building = system(2, apart1, apart2)
building2 = system(3, apart1,apart2,apart3)
where of course apart1, 2, and 3 are defined as class zone
.
I have tried something like:
for i in range(self.NumberOfZones)
self.zone = zone
But this doesn't work obviously.