val = [5,6,7,8] possible_combinations = [[]] while val: person = val.pop() new_combinations = [] for team in possible_combinations: new_combination =