佬们,为什么我的最后的代码中break提示在循环外
import random
global hand
hand = int(1000)
def winner(point1,point2,point3,bet):
global hand
if(point1+point2+point3 >= 11):
if(big_or_small == 'big'):
print('You Win!!!')
hand = hand + bet
else:
print('You Lose!!!')
hand = hand - bet
else:
if (big_or_small == 'small'):
print('You Win!!!')
hand = hand + bet
else:
print('You Lose!!!')
hand = hand - bet
def bet(hand):
print('You have ', hand ,'now')
bet = int(input('How much you wanna bet--- ?\n'))
if bet > hand:
print('You bet is error')
elif bet < 0:
print('How much you have now??\nGame Over')
else:
print('Your bet is begin')
print('<<<<< ROLE THE DICE!>>>>>')
print('The points is[', point1, point2, point3, ']!!!!!')
winner(point1, point2, point3,bet)
point1 = random.randrange(1,7)
point2 = random.randrange(1,7)
point3 = random.randrange(1,7)
print('<<<<< GAME STARTS! >>>>>')
big_or_small = input('Big or Small?\n')
bet(hand)
print('You have ', hand ,'now')
if hand > 0:
print('Do you want play again')
print('<<<<< GAME STARTS! >>>>>')
big_or_small = input('Big or Small?\n')
bet(hand)
else :
print('You cant play this game anymore')
break