In Python Using the random module write a function removeAnd
In Python
Using the random module, write a function removeAndReturnRandomElement(L) that selects an element from list L at random, removes it from the list and returns it.Solution
import random
def removeAndReturnRandomElement(L):
element=random.choice(L);
L.remove(element);
return element
