条件和错误的输入

时间:2017-04-30 22:08:55

标签: python

我试图让这回到条件“开始”#39;如果输入了错误的数据(Dice的任何数字小于或等于2,双方的数据为1,以便能够重新输入边数和骰子

condition = "Start" 
while condition == "Start": 
Dice = int(input("Please select number of dice you would like to use between 1 and 5")) 
Sides = int(input("Please select number of sides on dice you would like to use")) 
if (Dice >= 2 and Sides >= 1):
    condition = "Start"
else: 
#... rest of code here

0 个答案:

没有答案