while answer == 'Y':
roll = get_a_roll()
display_die(roll)
if roll == first_roll:
print("You lost!")
amount_won = roll
current_amount = amount_earned_this_roll + amount_won
amount_earned_this_rol = current_amoun
print("You won $",amount_won)
print( "You have $",current_amount)
print("")
answer = input("Do you want to go again? (y/n) ").upper()
if answer == 'N':
print("You left with $",current_amount)
else:
print("You left with $",current_amount)
使用此循环的目的是在游戏中,掷骰子,并且根据您的掷骰数获得奖励,除非您掷出与您的第一个掷骰相匹配的掷骰。现在,如果发生这种情况,我需要停止循环,并且我知道使用 break 语句很容易实现这一点,但是,我被告知不允许使用 break 语句。如果roll == first_roll,我还能如何让循环终止?