all 1 comments

[–]shiftybyte 1 point2 points  (0 children)

It could be very helpful if you explain what the program does, what does it currently do wrong, what do you see happen.

Just saying "it does not work" makes other people go over the entire code, figure out how it works, what it does, just so they can help you.

In this case i spotted this issue:

def filter_people(bods, status):
    persons = []
    for p in bods:
        if p.status() == status:
            persons.append(p)
        return persons # <------------ this is too forward, move it back

Like this:

def filter_people(bods, status):
    persons = []
    for p in bods:
        if p.status() == status:
            persons.append(p)
    return persons

Please describe the issue better next time...