python 随机生成任意数字任意长度的密码

[root@harbor ~]# cat test3.py
#!/usr/bin/python
import random
a=[]
for i in range(1,40):
  a.append(i)
random.shuffle(a)
b=[str(i) for i in a]
print b
c=''.join(b)[1:33]
print c,len(c)

  

posted @ 2019-08-27 17:01  骑猪追夕阳_577513827  阅读(675)  评论(0编辑  收藏  举报