假设我有一份颜色列表,colours = ['red', 'blue', 'green', 'purple']. 然后我希望调用我希望存在的这个python函数random_object = random_choice(colours).现在,如果random_object持有'蓝色',我希望colours = ['red', 'green', 'purple'].
colours = ['red', 'blue', 'green', 'purple']
random_object = random_choice(colours)
colours = ['red', 'green', 'purple']
python中是否存在这样的函数?
python random
python ×1
random ×1