pyrandtoys
v1.0.0
pyrandtoys是一个python模块,其中包含基于概率的玩具的功能。
它脱机工作,与Python 2和3兼容。
pip install pyrandtoys
import pyrandtoys
print(pyrandtoys.coin()) #there are many other toys in pyrandtoys similar to coin, check below
可选:骰子数<int>
默认:骰子数= 1
返回类型: <tuple>
dice(number_of_dice)
可选:硬币数量<int>
默认:硬币数= 1
返回类型: <tuple>
coin(number_of_coins)
可选:卡数<int>
默认值:卡数= 1
返回类型: <tuple>
card(number_of_cards)
可选:项目数<int>
默认值:项目数= 1
返回类型: <tuple>
dreidel(number_of_dreis)
cat(number_of_cats)
switch(number_of_switches)
必需:下限和上限<int>
默认值:下限= 0
返回类型: <int>
spinner(lowerLimit, upperLimit)
返回类型: <tuple>
默认值:玩具数= 0
如果您想使用玩具组合,那么
必需:玩具的名称为<tuple>, <list>, <str>
combi("coin", "switch")
combi(("switch", "cat", "dice"))
combi(["dreidel", "coin", "coin", "cat"])
为了组合X随机玩具,
combi(x)