python生成随机字符串
![作者头像](https://ask.qcloudimg.com/http-save/yehe-2398817/h3w8ny4lj.jpeg)
py3study
发布
于
2020-01-09 15:53:09
发布
于
2020-01-09 15:53:09
import random,string
def genRandomString(slen=10):
return ''.join(random.sample(string.ascii_letters + string.digits, slen))
![这里写图片描述](https://ask.qcloudimg.com/http-save/yehe-2398817/g5amp7z75k.png)
这里写图片描述
本文参与
腾讯云自媒体分享计划
,分享自作者个人站点/博客。
原始发表:2019-08-26 ,
如有侵权请联系
cloudcommunity@tencent.com
删除
评论
登录
后参与评论