Game of chance cart pick why wont it print

The print() will not give feedback so i can’t see if some thing went wrong
While the code resolve without a error.

import random
card_one = random.randint(1, 9)
card_two = random.randint(1, 9)
money_one = 100
money_two = 100
def high_card(player_one, player_two, bet_one, bet_two):
  if card_one <= card_two:
    result = "you lose"
    total_bet = (money_one - bet_one) + money_two + bet_two + bet_one
  if card_one >= card_two:
    result = "you won"
    total_bet = (money_two - bet_two) + money_one + bet_one + bet_two
    result = "it's a ti"
    print("Player one flipt a %s Player two flipt a %s Player one called %s Player two called %s player one You %s and now have $%.2f, player two You %s and now have $%.2f" %(card_one, card_two, player_one, player_two, result, total_bet))
money = high_card(2, 3, 30, 80)

the print() is part of else clause, so only when the two cards are equal you will see output

1 Like

how can i get it working without making mutiple print statements?

well, then the print statement should be outside/after the else clause. Decide when you want the print() to run and nest it accordingly.

1 Like

Tanks i can tinker on with the code. Hope i can get it working

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.