Let's say I have a list of colors colours = ['red', 'blue', 'green', 'purple'].
Then I want to call this python function that I hope exists random_object = random_choice(colours). Now, if random_object has "blue", I hope that colours = ['red', 'green', 'purple'].
Is there such a function in python?
source
share