【发布时间】:2020-08-11 13:28:08
【问题描述】:
dice = [1, 2, 3, 4, 5, 6]
first = [random.choice(dice) for i in range(5)]
print(first)
while True:
baggage = []
retry = random.choice(dice)
F = input("Choose the dice you want to roll again. (if you don't want to roll again, enter the '0'.)>")
baggage.append(F)
del first[int(F)-1]
first.insert(int(F)-1, retry)
if F == '0' or len(baggage) > 5:
break
print(first)
run > ValueError: int() 以 10 为底的无效文字:''
帮助...
【问题讨论】:
-
运行程序时输入的输入值是多少?
-
介于 1 到 5...
-
@Aziz 错误消息显示,它是一个空字符串文字
-
@MZ omg 我意识到我的错误谢谢????????
标签: python python-3.x