nick.martin...@aol.com (nick martinez2) writes:

> def rollDie(number):
>     rolls = [0] * 6
>     for i in range(0, number):
>         roll=int(random.randint(1,6))
>         rolls[roll - 1] += 1
>     return rolls

def rollDie(number):
    from random import choices
    return choices((1,2,3,4,5,6), k=number)

ps: sorry for the noise if someone else in this thread has already
highlighted the usefulness of `random.choices`
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to