我将如何允许 random.choice 从列表中选择一个项目(一次、两次或三次),然后从列表中删除。
例如,它可能是 1-10,并且在选择 1 之后,在程序重置之前不再允许选择 1
这是一个虚构的例子,用颜色和数字代替了我的话
colors = ["red","blue","orange","green"]
numbers = ["1","2","3","4","5"]
designs = ["stripes","dots","plaid"]
random.choice (colors)
if colors == "red":
print ("red")
random.choice (numbers)
if numbers == "2":##Right here is where I want an item temporarily removed(stripes for example)
random.choice (design)
我希望这会有所帮助,我正在尝试对我的实际项目保密=\ 抱歉给您带来不便
忘了在代码中提到,在红色被选中后也需要删除