Python dice rolling simulation

前端 未结 4 1943
借酒劲吻你
借酒劲吻你 2021-01-16 08:58

I\'m having trouble with a code where I need to roll a six-sided die 1000 times and then return a list of how many times each number on the die was rolled.

The code

4条回答
  •  隐瞒了意图╮
    2021-01-16 09:02

    You should do random.randint(1, 7), otherwise you will never get a 6.

    ...
    roll = random.randint(1, 7)
    

提交回复
热议问题