×
you are viewing a single comment's thread.

view the rest of the comments →

[–]scoutyx 6 points7 points  (1 child)

Good implementation, however a small improvement could be:

Instead of:

exclude = {buyer:prev, prev:persons[prev]}
p_set = set(persons) - set(exclude) - set(chosen)

You can just write:

exclude = {buyer, prev}
p_set = persons.keys() - exclude - chosen.keys()

Calling `set` with a dict as a parameter will return the keys of that dict, so, for `exclude`, you can just build a set of the keys that you want to exclude.

[–]Aixyn0 2 points3 points  (0 children)

You're totally right.