-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLab4TJ.py
More file actions
51 lines (29 loc) · 977 Bytes
/
Lab4TJ.py
File metadata and controls
51 lines (29 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#--------------------------
# Lab2TJ.py -
#--------------------------
# Teagan Johner -
#--------------------------
import random
def make_deck():
suits = 'DCHS'
pips = 'A23456789TJQK'
deck = []
for i in range(len(suits)):
for c in range(len(pips)):
deck.append( pips[c] + suits[i] )
random.shuffle(deck)
return deck
def deal_blackjack(deck, num_of_players):
table = []
for c in range(num_of_players):
hands = []
for i in range(2):
hands.append(deck.pop(0))
table.append(hands)
return table
def print_blackjack(hands):
for c in range(len(hands[0])):
print()
for i in range(len(hands)):
print(hands[i][c], ' ', end = '')
#def get_max(hands):