header ads

Python for Generate Password

Python Password Generator 




Python code for Generating a strong password. random package used to generate a password. 

Code


import random

lower = "abcdefgijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
symbols = "[]{}()*;/,._-"

all = lower + upper + numbers + symbols
length = 16
password = "".join(random.sample(all,length))

print(password)



How to Run 

1. Copy the code.
2. Paste the code in your Python IDE or Notepad file.
3. Save the file in filename.py format.
4. Open a Terminal or cmd to current working directory.
5. Type python filename.py and hit Enter.

Post a Comment

0 Comments