📜  掷骰子模拟器python代码示例

📅  最后修改于: 2022-03-11 14:46:51.599000             🧑  作者: Mango

代码示例1
from random import randint

def roll_dice():
    print(f"Number is: {randint(1,6)}")

# Do this to simulate once
roll_dice()   

# Do this to simulate multiple times
whatever = 12 # Put the number of times you want to simulate here
for number in range(whatever):
    roll_dice()