python模拟大话骰小游戏

代码

# -*- coding: utf-8 -*-
"""
Created on Sat Jun  5 21:58:56 2021

@author: li
"""

import random
shaizi = [1,2,3,4,5,6]

import random




def Computer_count(num,dianshu,computer_shaizi):
    Bool_list = [True,False]
    num = int(num)
    dianshu = int(dianshu )
    
    computer_label = random.choices(Bool_list)
    if computer_label[0] == True:
        return True, num,dianshu
    
    computer_num = num + 1
    computer_dianshu = random.choices([1,2,3,4,5,6])[0]
    print("电脑报的数为:",computer_num ,"个", computer_dianshu)
    return computer_label[0] ,   computer_num,   computer_dianshu


computer_label = False
my_label = False


computer_shaizi = random.choices(shaizi,k=5)

my_shaizi = random.choices(shaizi,k=5)




while not(computer_label | my_label):
    print("你的筛子是",my_shaizi)
    print("请开始报数:")
    num &#
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值