Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- Random = random.randint(0,51)
- popcorn = [1, 2, 3, 4, 5]
- numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A']
- spades = ['SP' + '1','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP','SP']
- hearts = ['HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE', 'HE']
- diamonds = ['DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI', 'DI']
- clubs = ['CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL','CL']
- def deckblder(numbers, spades, hearts, diamonds, clubs):
- numbersd = zip(numbers, diamonds)
- numbersh = zip(numbers, hearts)
- numberss = zip(numbers, spades)
- numbersc = zip(numbers, clubs)
- deck = numbersd + popcorn + numbersh + numberss + numbersc
- return deck
- cards = deckblder(numbers, spades, hearts, diamonds, clubs)
- #print cards.pop(Random)
- def dealer(cards):
- ask = int(raw_input('How many cards? '))
- rag = range(0, ask)
- rag2 = 52
- hand = []
- for num in rag:
- rag2 = rag2 - 1
- Random = random.randint(0,rag2)
- deal = cards.pop(Random)
- hand.append(deal), hand.append(popcorn[0])
- return hand
- play = dealer(cards)
- print play
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement