How To Generate Strong Passwords Using Python

Hillary Nyakundi - Mar 9 '21 - - Dev Community

How many times have you gone to a site been asked to create an account and they need a password which is both a combination of letters both lower and upper, special keys and numbers. Am sure its several times. Have you been able to do that? or you do use the suggested passwords.

Do you even go a step further and try to think how the suggested passwords are generated, For sometime I wondered too 🤔, but after some research I figured out how. Now I need you to figure it too.

Well its time we change that, what if you could write a code that could generate the passwords you need at once. Won't that be great. Well in this Article am going to show you how you can do that using python.

Steps To Create Password Generator

  1. Make sure you have a code editor and python installed in your computer.(preferred pycharm)
  2. Open PyCharm, Click file->New Project. and specify the file or folder location for your work.
  3. In your folder you just created, you will need to create a python file. Right Click on folder-> New-> Select python file. Give it a name
  4. Start Coding;

Below is a Code snippet:

import string
import random

passwrd = string.ascii_letters+string.digits+string.punctuation

numPass = int(input("How many passwords do you need to be generated? "))
length = int(input("Enter the length of the password(s): "))
Enter fullscreen mode Exit fullscreen mode

Full Code Link: Here

Check Out Video Tutorial:
How to Create a Random Password Generator Using Python

If You have read this far I really appreciate, Help me to grow my community:

Check out my other Blogs too:

Connect With me at Twitter | Insta | YouTube | LinkedIn | GitHub

Do share your valuable opinion, I appreciate your honest feedback!

Enjoy Coding ❤

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player