【零基础学习记录】python双色球游戏

**

Python学习记录 双色球

**
记录一下第一个自己写的程序。
单纯记录一下,写的极其下饭。
在这里插入图片描述

red_ball=[]
blue_ball=[]
ccount=0
print('-------------欢迎来到双色球------------')
count =  ( 0 )
while count<6:
    count+=1
    print(count)
    a=int(input('\033[37;41m请输入红色球\033[0m'))
    g=(a not in red_ball)
    if a>0 and a<32 and g==(True):
        red_ball.append(a)
    else:
        count-=1
        print('请输入1到31的数字且不要重复输入同样的数字')
print('\033[37;41m红色球:\033[0m')
print(red_ball)
while count<8:
    count+=1
    print(count-6)
    b=int(input('\033[37;44m请输入蓝色球\033[0m'))
    h=(b in blue_ball)
    if b>0 and b<17 and h==(False):
        blue_ball.append(b)
    else:
        count-=1
        print('请输入1到16的数字且不要重复输入同样的数字')
print('您的选择:')
print('\033[37;41m红色球\033[0m',red_ball,'\033[37;44m蓝色球\033[0m',blue_ball)
import random
c=0
while c<1:
    c+=1
    e=random.randint(1, 31)
    r=random.randint(1, 31)
    t=random.randint(1, 31)
    y=random.randint(1, 31)
    u=random.randint(1, 31)
    i=random.randint(1, 31)
    o=random.randint(1, 16)
    p=random.randint(1, 16)
    if e!=r!=t!=y!=u!=i!=o!=p:
        print('----------------准备开奖!-------------')
    else:
        c-=1
price_red=[e,r,t,y,u,i]
price_blue=[o,p]
if red_ball == price_red and blue_ball==price_blue:
    print('恭喜你中奖500万!')
elif red_ball==price_red:
    print('恭喜你中奖100万!')
elif blue_ball==price_blue:
    print('恭喜你中奖10万!')
else:
    print('抱歉,运气有点差呢。')
print('大奖号码是:',
      "红色球",price_red,'蓝色球',price_blue)
print('-------------------End--------------------')
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值