0

So I have a function,

def Multiples(OGvalue, count):
    multiples = []
    for i in range(count):
        multiples.append(i*OGvalue)
    multiples.pop(1), multiples.pop(0)
    return (multiples[randrange(len(multiples))])

that is being called elsewhere in my program. Now, I don't want to random value that is given to repeat, so I want to remove it from my array after it is used, how would I go about doing that?

Mike67
  • 11,175
  • 2
  • 7
  • 15
Husk
  • 1
  • 1
  • Hi, perhaps shuffle might help https://stackoverflow.com/questions/976882/shuffling-a-list-of-objects – IronMan Oct 30 '20 at 00:15
  • You need to store the numbers that have already occurred in a global variable or class variable. But what happens when you have used all the multiples? What is the problem you are trying to solve with Multiples? – GordonAitchJay Oct 30 '20 at 05:08

0 Answers0