凯发娱乐城

注册游戏账号

新葡京娱乐城

进入游戏大厅

博天堂娱乐城

真人棋牌游戏开户

您现在的位置:主页 > 在线棋牌游戏 > 正文

在线棋牌游戏用python编一个扔骰子猜大小的游戏

来源:http://lehu6677.com 作者:在线棋牌游戏

真人棋牌游戏

博天堂

  搜集的资料: import random def game(w, l):     def winning():         print("You are right.")         again(w+1, l)     def losing():         print("You are wrong.")         again(w, l+1)     def again(w, l):         ans = input("Play again?(y/n)")         if ans == n:             print("You played %s rounds, and you won %s rounds" % (w+l, w))         elif ans == y:             game(w, l)         else:             again(w, l)     guess = input("Please input your guess(big/small): ")     dice = random.randrange(1, 7)     if guess == "small":         winning() if dice <= 3 else losing()     elif guess == "big":         winning() if dice >= 4 else losing()     else:         game(w, l) if __name__ == __main__:     game(0, 0)

  • 原文标题:在线棋牌游戏用python编一个扔骰子猜大小的游戏
  • xpj

    9you娱乐城

    特别推荐