Python Forum
Choosing a random variable from 2 lists
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Choosing a random variable from 2 lists
#6
When i make the deck it has 52 card in order.
Using random.shuffle shuffle the deck in place.
So running the code it will never choose the same card twice when dealing out 5 cards.
Which i think solve his task.

if taking task further where used card can not be chosen again it can be a problem.
Then has to use something like list.pop to get cards out of deck.
Reply


Messages In This Thread
RE: Choosing a random variable from 2 lists - by snippsat - Mar-26-2017, 12:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020