I shouldn't get the same card twice in the same batch, no.
Of course, in separate trials, I may get the same card again.

Basically, I type the names of relevant cards in a list, and proceed to "tell" my program which list to read, and how many cards to pick from that list.

Normally, I put each card name in the list only once. But if I type the same card name twice, the program sees the repetitions as different entities, and may display both of 'em if the randomness works out that way.

random.sample I think runs dependent trials (the first pick affects the odds of the second pick, etc.) - kind of like pulling tickets from a hat.
This is as opposed to independent random trials a la dice rolling.

Someone correct me if I'm wrong on this - for this application, I want dependent trials.

Quoting OmerT <[EMAIL PROTECTED]>:

I'm unfamiliar with the random.sample function, yet I can't help but wonder:
Do you ever got the same card twice?
Is that intentional ?


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to