**
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--------------------')