How to get multiple child class to run in constraints of a parent class
<p>I am new to programming and i am just going through a python book. I want to have multiple robots to run inside a map. There will be multiple Robot(s) in a Map. what do i need to do to the map class to have it work this way? I know this is vague but i am 14 and trying hard to explain this.</p>

<pre><code>class Map:

    def __init__(self):
        self.robot = []

    def add_robot(self, robot):
        self.robot.add(Robot)

    def is_occupied(self, x, y):
        for r in self.robot:
            if r.xpos == x and r.ypos == y:
                return True
        return False


class Robot(Map):

    def __init__(self):
        self.xpos = 0
        self.ypos = 0

    def step(self, axis):
        if axis in "xX":
            if self.is_occupied(self.xpos+1, self.ypos):
                self.xpos += 1 
                print "step X axis"
        elif axis in "yY":
            self.ypos += 1

    def walk(self, axis, steps=2):
        for i in range(steps):
            self.step(axis)

    def get_pos(self):
        print "X:%i  Y:%i" % (self.xpos, self.ypos)


robot1 = Robot()
robot1.walk("x", 5)
robot1.get_pos()
</code></pre>

<p>If i do not have the 'Map' class this works just fine but i cannot get map class to work. I got help making the map class but i cant get it to work with my Robot class.</p>
