Here is the simple Password generator in Python.
# Password generator. import random password = "" # Ask for password length. pass_length = int( input("Enter password length: \n") ) for i in range(pass_length): num = random.randint(33, 126) # ASCII Characters. password += (chr(num)) print(f"Password: {password})
Output:
Enter password length: 9
%O&W{V5/z
random
module.for-loop
to generate the password for a specific length.You can also watch the demo here.
This is all about Simple Password Generator in Python. Keep automating the boring stuff.
For more such important Python tips and tricks follow us on YouTube.
Happy Pythoning!