[python]代码库
# 双色球机选
import random
red=['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33']
blue=['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16']
# 单复式
# r=7
# b=2
# choose_red=random.sample(red,r)
# choose_blue=random.sample(blue,b)
# print('红球:',choose_red,' ''蓝球:',choose_blue)
# 机选五注
print('红球:',random.sample(red,6),' ','蓝球:',random.sample(blue,1))
print('红球:',random.sample(red,6),' ','蓝球:',random.sample(blue,1))
print('红球:',random.sample(red,6),' ','蓝球:',random.sample(blue,1))
print('红球:',random.sample(red,6),' ','蓝球:',random.sample(blue,1))
print('红球:',random.sample(red,6),' ','蓝球:',random.sample(blue,1))
# 大乐透机选
import random
front=['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35']
after=['01','02','03','04','05','06','07','08','09','10','11','12']
# 单复式
# f=7
# a=2
# choose_front=random.sample(front,f)
# choose_after=random.sample(after,a)
# print('前区:',choose_front,' ''后区:',choose_after)
# 机选五注
print('前区:',random.sample(front,5),' ','后区:',random.sample(after,2))
print('前区:',random.sample(front,5),' ','后区:',random.sample(after,2))
print('前区:',random.sample(front,5),' ','后区:',random.sample(after,2))
print('前区:',random.sample(front,5),' ','后区:',random.sample(after,2))
print('前区:',random.sample(front,5),' ','后区:',random.sample(after,2))
[代码运行效果截图]
[源代码打包下载]
中级程序员
by: ybl006 发表于:2021-08-15 15:47:19 顶(0) | 踩(0) 回复
555555555555
回复评论