A password prevents others from accessing our system’s e-mails and other login information. In this article, I’ll walk you through how to create a password picker with Python to create safe and easy-to-remember passwords that will help your information to be kept private and secure.
What is a Password Picker?
A password picker is an application that allows you to create strong passwords by combining words, numbers, and special characters. A password picker will create a new password and show it to you every time you run your program which is the main logic behind creating a password picker with Python.
Also, Read – 100+ Machine Learning Projects Solved and Explained.
Your program should keep creating a new password again and again until you find a strong and easy to remember.
A password picker randomly selects each of the four criteria i.e. adjective, name, number, special character and puts them together to create a strong password and display it on the screen. In the process, if you want another password, the program will repeat the steps, and if you no longer need a new password, the program will end.
Password Picker with Python
In this section, I will walk you through how to create a password picker with Python using the random module in Python. Our program should use random choices from the group of adjectives, nouns, numbers, and special characters. Now let’s see how to create a password picker with Python.
I will start by importing the random module in Python. Then I will print a welcome message to the user:
Now I will create a list of adjectives for creating a password picker using Python:
Now I will create a list of nouns as we will need both nouns and adjectives to create new passwords:
Now I will write the code for picking a random word from the above lists. We can use the choice function in the random module for this task:
Now I will use the randrange() function in the random module to select a random number between 0 and 99. Then I will use the choice function again to pick a random punctuation mark:
Now let’s combine everything to create a new password:
You can also use a while loop to generate another password if the user demands a different password:
Welcome to Password Picker You Password is : wetgoat76< Would you like another password? Type Y or N: N
This application can personally help you to create strong passwords. You can get the complete code from below to create a Password picker with Python programming language.
I hope you liked this article on how to create a password picker with Python. Feel free to ask your valuable questions in the comments section below.