我想为我的侄子做一个骰子tosser,所以他可以玩没有骰子的棋盘游戏。即使我输入了一个真实的条件,我也陷入了一个while循环。我试图让他选择他想用的骰子,但是如果他选择了一个错误的骰子,那么它会要求他再次输入。我的代码是...卡在while循环
dice_select = input('Enter the amount of sides are on the dice you want to throw, either 4, 6, or 12: ')
while dice_select != 4 or dice_select != 6 or dice_select != 12:
dice_select = int(input('Sorry thats not quite right. Enter the amount of sides are on the dice you want to throw, either 4, 6, or 12: '))
如果我输入4,6或12,那么当它应该继续时,它仍然使我进入循环。
条件可能是错误的唯一方法是如果'dice_select'等于4,6和12全部在同一时间。 –
重新阅读你的状况。评估它的价值,你寻求。当'dice_select'是'4'时会发生什么? – njzk2