lundi 25 avril 2016

Python: How to limit the amount of random output I am getting to a specific amount?

So, I have made the function

def randArrow():
    randArrow = ['left', 'right', 'down', 'up']
    print(random.choice(randArrow))
    clock.tick(15)

The function works, but it produces infinite amount of choices. How do I limit it to produce, say, 15 different choices?




Aucun commentaire:

Enregistrer un commentaire