python内置模块

 

 

 

 

 

一个双色球的小例子:

import random as rd


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
seqBlueList = ['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']
seqRedList = ['01','02','03','04','05','06','07','08',\
'09','10','11','12','13','14','15','16']

seqBlue = rd.sample(seqBlueList,6)
seqRed = rd.sample(seqRedList,1)

seqBlue.sort()

seq = []
seq.append(seqBlue)
#seq.append(" + ")
seq.append(seqRed)
print(seq)

 

posted @ 2021-11-26 13:53  泽良_小涛  阅读(35)  评论(0编辑  收藏  举报