Hi there, let's create a which is super quick & super fun! Password Generator Python Project How do Password Generators work? Password Generators are nothing but simple programs which are capable of randomly creating strings which consists of letters, numbers & symbols. The Password Generator we are going to make will take the length of the password as an input and will generate a random password of the same size. Here's an example: Input: Enter the length of the password: 7 Output: 5: <, $v9 So here, when we ran the code we were asked for the size of the password to be generated. We entered the as the input. And we got a random 7-digit password as output. 7 You can also see that our password consists of numbers, alphabets & symbols which are highly recommended to be used in a password to make it stronger and difficult to guess & brute force. Alright now since you know how our password generator is going to work, now let's get into coding. Let's Code Alright, so the very first thing we do is to import the required modules for the project. In this case, since we need to create random strings as mentioned before, we are going to make use of the module. So let's quickly import it. random random import Now let's get the input for the length of the password to be generated. pass_len = int(input( )) "Enter the length of the password: " Here we go! We are going to store the input in **pass_len** variable. Also notice that we are making use of function. That's because the input we get from the user will be in datatype but to make use of this input we first need to convert it into an datatype. will convert our input from to . int() string int int() string int Now let's move to the next step. pass_data = "qwertyuiopasdfgjklzxcvbnm1234567890[];',./!@#$%^&*()_+:<>?" Here we have simply defined a string that consists of all the alphabets, numbers & symbols which will be used to generate the password. You can customize this variable as per your wish. If you want to create a password consisting only of alphabets then you can get rid of symbols and numbers from this variable and the resulting password will be consisting only of alphabets. Let's Finish it!!! password = .join(random.sample(pass_data, pass_len)) "" Here on this final step, we have used the function which will join our generated password to an empty string on the left. join() Within , we have function which does the main job of generating a password. join() random.sample() takes in our variable which consists of our raw password characters and the variable which is the user input from the user regarding the length of the password. Basically what it will do is that it will take random characters from variable of length . random.sample() pass_data pass_len pass_data pass_len Now finally let's print out the final output! print(password) Source Code You can find the complete source code of this project here: mindninjaX/Python-Projects-for-Beginners Support Thank you so much for reading! I hope you found this beginner project useful. If you like my work please consider so that I can bring more projects, more articles for you. Buying me a Coffee Also if you have any questions or doubts feel free to contact me on , & . Or you can also post a comment/discussion & I will try my best to help you :D Twitter LinkedIn GitHub