(chips)
| 108 | |
| 109 | |
| 110 | def 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 | |
| 126 | def hit(deck, hand): |