[Tutor] A class list

Robert Berman bermanrl at cfl.rr.com
Fri Dec 24 22:04:44 CET 2010

From: Noah Hall [mailto:enalicho at gmail.com] 
Sent: Friday, December 24, 2010 2:36 PM
To: Robert Berman
Subject: Re: [Tutor] A class list


Alright, I'll begin by saying that you shouldn't use a list for cards , and a
separate one for players. Instead, you should use dictionaries. For example -

players = { 1: "John", 2:"Phil",..,n:"Ed"}

Or, using your method -

for x in random.sample(xrange(low,high),n):

players[x] = random.sample(list_of_names, len(list_of_names))

When I get back from holiday, I'll go through your code more thoroughly and
give you a pointer in the right direction.


>> Really big snip.




Thanks for your prompt reply which generates its own unique question. You are
saying I should have some concern for the players. But I don't care about the
people playing. I care about the cards in play and the card that reaches
Bingo. I care about the winner only to the extent I want to know how many
numbers have been pulled from the cage for him/her to achieve Bingo. Other
than that, I don't care so please elaborate why I care about the players;
Besides I really cannot see why I should generate  names(n) when card(n) will
do just as nicely; I think.


Thanks again,






I am using the Free version of SPAMfighter <http://www.spamfighter.com/len> .
SPAMfighter has removed 174 of my spam emails to date.

Do you have a slow PC? <http://www.spamfighter.com/SLOW-PCfighter?cid=sigen>
Try free scan! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101224/a64f9a70/attachment-0001.html>

More information about the Tutor mailing list