欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

在python中轻松创建随机密码的方法 - JMU版本

最编程 2024-08-02 07:02:03
...
#!/usr/bin/python #-*-conding:utf-8-*- #密码随机生成器,密码长度由用户输入,用户可以自己设置密码长度 import random import string def getRandompwd(pwd_length): password = '' for i in range(pwd_length): password = str(password + str(random.randrange(0,10))) print(password) pwd_length = int(input("please input the password length:")) getRandompwd(pwd_length)

推荐阅读