On 6/1/08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > dave <[EMAIL PROTECTED]> writes: > [..]
> > > > def deal_cards(self, num_of_hands, num): > > '''deals x amount of cards(num) to each hand''' > > for i in range(num_of_hands): > > handname = Hand('hand%d' % i) > > self.deal(handname, num) > > print '::::%s::::' % (handname.label), '\n', handname, '\n' > > > > > You need to use a 'return' statement: > > > def deal_cards(self, num_of_hands, num): > '''deals x amount of cards(num) to each hand''' > > hands = [] > > for i in range(num_of_hands): > > newhand = Hand('hand%d' % i) > self.deal(newhand, num) > hands.append(newhand) > > print '::::%s::::' % (handname.label), '\n', handname, '\n' > > return Hand Should be: return hands > > > Then you can write: > > >>> hands = deck.deal_cards(4, 5) # On fait une belotte? > [...] -- http://mail.python.org/mailman/listinfo/python-list