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)