自从知道string模块后再也不用abcd了

>>> string.digits                         #数字
'0123456789' >>> string.ascii_letters #大小写
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> string.ascii_lowercase #小写
'abcdefghijklmnopqrstuvwxyz' >>> string.ascii_uppercase #大写
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> string.punctuation #标点符号
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' >>> string.ascii_lowercase+string.digits #相加
'abcdefghijklmnopqrstuvwxyz0123456789' >>> s=string.ascii_lowercase+string.digits
>>> s
'abcdefghijklmnopqrstuvwxyz0123456789'
>>> c=random.sample(s,5) #random.sample() 随机数
>>> c
['1', '7', 't', 'd', '3']
>>> ''.join(c)
'17td3'
#随机数
>>> ''.join(random.sample(string.ascii_lowercase+string.digits+string.punctuation,6))
',8kn&h'
05-29 01:09