def pickSubs(self, subjects, maxWork, maxLottery):
    totWork = 0
    totLott = 0
    studentSubs = []
    for s in subjects:
        totWork += s.getWork()
        totLott += s.getLottery()
        if totLott <= maxLottery and totWork <= maxWork:
                studentSubs.append(s)
    return studentSubs 
I am trying to use comparators to decide best choices for a student based on different factors.
My issue is I want to append all possible objects 's' if the total work and lottery values are under maxWork, maxLottery but I am not appending all possible combinations. I am just appending until I reach max constraint value
How can I get all possible combinations?
 
    