一、这里用到了:String模块ascii_letters和digits

''.join(random.sample(string.ascii_letters + string.digits, 9))
1、random.sample(string.ascii_letters + string.digits, 9)表示随机抽取9位
2、str.join以某字符串,把抽取的字符连接起来
str = "-"; seq = ("a", "b", "c");
# 字符串序列
print str.join( seq );
输出a-b-c

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-30
  • 2021-11-27
  • 2022-01-24
  • 2022-12-23
  • 2021-11-30
  • 2021-12-18
相关资源
相似解决方案