Good evening! Still new to programming, so naked with me. A simple question, I hope!
I have data in a list, for example:
L = [(3,4,5),(1,4,5),(1,2,3),(1,2,3)]
I need to arbitrarily choose size 2, so I wanted to use:
import random t1 = random.sample(set(L),2)
Now T1 is a list of random values, but I wanted to remove those that were accidentally extracted from our original list from our original list. I could do a linear loop, but for the task I'm trying to do for a larger list. so the lead time will be forever!
Any suggestions on how to do this?
source share