Alternative to Yield in Python
Question: Is there an alternative (even if longer) method of writing the `yield` part of
this code? I'm not very familiar with the function and would rather keep it
simple.

    
    
    for i in range(0, len(lstInput) - intCount + 1):
        if intCount == 1:
            yield [lstInput[i]]
        else:
            current = lstInput[i]
            remainder = lstInput[i+1:]
            for rest in yieldLotto(remainder, intCount - 1):
                yield [current] + rest
    


Answer: The alternative is to either embed the loops into your calling program, or to
change it to return a list. This means everything will be going into memory,
though.

    
    
    def foo():
        return_list = []
        for i in range(0, len(lstInput) - intCount + 1):
            if intCount == 1:
                return_list.append([lstInput[i]])
            else:
                current = lstInput[i]
                remainder = lstInput[i+1:]
                for rest in yieldLotto(remainder, intCount - 1):
                    return_list.append([current] + rest)
        return return_list
    

Honestly though, I think yield is better and it's an important feature of
Python. I suggest learning it.

