Beginner Question

Garry Knight garryknight at gmx.net
Thu Mar 27 21:23:12 EST 2003


Kevin Reeder wrote:

>       self.cards[i], self.cards[j] = self.cards[j], self.cards[i]
> 
> The problem is to rewrite the last line without using a sequence
> assignment.

One way is by using a temporary variable:
        t = self.cards[i]
        self.cards[i] = self.cards[j]
        self.cards[j] = t

-- 
Garry Knight
garryknight at gmx.net   ICQ: 126351135
Linux registered user 182025




More information about the Python-list mailing list