On May 13, 2:39 pm, Georgy Panterov <[EMAIL PROTECTED]> wrote: > > def deal_hand(deck): > HAND=[] > for _ in range(2): > i=random.randint(0,len(deck)) #produces a random card from the deck ^ Here i can be from 0 thru (the number of cards in the deck).
> HAND.append(deck[i]) # appends the card to the players' hand list ^ Here you index into the deck to get a card. The legal indexes are 0 thru (number of cards in the deck - 1) What happens if i is (the number of cards in the deck)? > deck.remove(deck[i]) #removes the card from the deck > return HAND > -- http://mail.python.org/mailman/listinfo/python-list