jeudi 29 octobre 2020

How do I pop the value returned from my array?

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?




Aucun commentaire:

Enregistrer un commentaire