I'm working in Python, and basically I have a list of integers:
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10]
with the variable total
, and I'm trying to figure out how to produce random numbers from this list (without replacement) until the 10 is produced, and then stop. I'm thinking that this would use random.shuffle
within a while loop, but I'm not sure. Any tips or advice?