On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > i = p.index(current_player) > opponents = p[:i-1] + p[i+1:] > > An alternative is this: > > opponents = tuple(x for x in p if x is not current_player) > > You may disagree, but in my opinion, the alternative is better because > it is a more natural translation of the concept that the opponents of > the current player are all players that are not the current player.
Your alternative is wrong because it wont raise ValueError if current_player is not present in the tuple. Please revise your "solution." -- mvh Björn -- http://mail.python.org/mailman/listinfo/python-list