我想知道如何让这个else语句正常工作。使用python
Dice = int(input("Please select number of dice you would like to use between 1 and 5"))
if (Dice >= 1):
else:
condition == "Start"
答案 0 :(得分:1)
你可能想测试数字1和5之间的输入:
dice = int(input("Please select number of dice you would like to use between 1 and 5: "))
condition = "Start" if 1 <= dice <= 5 else "Other string"
答案 1 :(得分:0)
我猜你正在寻找的东西)
if (Dice >= 1):
condition = "Start"
else:
condition = "Stop"