MCPcopy Index your code
hub / github.com/geekcomputers/Python / take_bet

Function take_bet

BlackJack_game/blackjack_rr.py:110–123  ·  view source on GitHub ↗
(chips)

Source from the content-addressed store, hash-verified

108
109
110def take_bet(chips):
111 while True:
112 try:
113 chips.bet = int(input("How many chips would you like to bet? "))
114 except ValueError:
115 print("Your bet must be an integer! Try again.")
116 else:
117 if chips.bet > chips.total or chips.bet <= 0:
118 print(
119 "Your bet cannot exceed your balance and you have to enter a positive bet! Your current balance is: ",
120 chips.total,
121 )
122 else:
123 break
124
125
126def hit(deck, hand):

Callers 1

blackjack_rr.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected