I need to pick random elements from a list. And the number of random elements is larger than the length of the list (so I will have duplicates). Therefore I can't use random.sample(), because the sample can't be larger than the population. Does anyone have a solution?
For example:
lst = [1,2,3,4]
How can I pick 5 random elements from this list, like [1,4,3,1,2]?