PasswordGenerator in Python | How to code for password generator using python| python password generator
Password Generator Randomly in Python
Here is the code to generate password randomly:
import random
import string
password=''
def strPass():
lowerch=string.ascii_lowercase
upperch=string.ascii_uppercase
symbol=string.punctuation
num=string.digits
password=random.choice(lowerch)+random.choice(upperch)+random.choice(symbol)+random.choice(num)
return password
pwd=strPass()
if len(pwd)<8:
p=strPass()
pwd=pwd+p
print(pwd)
Note: If you want that your password length should be exceed 8, so you can change the number 8 by your wish.
No comments:
Post a Comment