SG_CoinFlipAll.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:SolutionGambling 作者: eganwall 项目源码 文件源码
def play_coin_toss(wager_amount):
    coin_result = flip_coin()

    if (coin_result == "HEADS"):
        outcome = SG_Repository.WagerOutcome.WIN
        winnings = wager_amount * 2
    else:
        outcome = SG_Repository.WagerOutcome.LOSE
        winnings = 0

    wager_result = {'toss_result' : coin_result, 'outcome' : outcome,
                    'winnings' : winnings}

    print("Coin toss wager result:")
    pprint.pprint(wager_result)

    return wager_result

# create our Reddit instance
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号