A beginners guide to Password Generator using Python with full code

Here is a step-by-step solution to make a password generator in Python 3.9

First, import a library called random. Then, set four variables with lower caps words, higher caps words, numbers and symbols accordingly. Next, set a variable and set the sum of those four variables that we created earlier. After that, set a length. Now, create another variable named password and set the value as shown in the code below. At last, add the print function as shown below. In this way, you can create your very own password generator in python.

import random
print("Welcome to the password generator by Muksifur.com")
lowercaps = "abcdefghijklmnopqrstuvwxyz"
uppercaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
symbols = "!@#$%{}?|~`*<>_-.+|\!;^,"
all = symbols + lowercaps + symbols + uppercaps
length = int(input("How long do you want your password to be(in number)\n"))
password = "".join(random.sample(all, length))
print(f"Your password is {password}")

8 Comments

  1. It’s great that you are getting ideas from this piece
    of writing as well as from our discussion made at this time.

  2. Hi there, i read your blog from time to time and i own a similar one and i was
    just curious if you get a lot of spam feedback? If so how do you
    reduce it, any plugin or anything you can advise? I get so
    much lately it’s driving me insane so any support is very much appreciated.

  3. After looking into a number of the blog articles on your web site, I really appreciate your technique of writing a blog.

    I book-marked it to my bookmark webpage list and will be checking back soon.

  4. hey there and thank you for your information – I have definitely picked up anything new from right here.
    I did however expertise a few technical issues using this website,
    as I experienced to reload the website a lot of times previous to
    I could get it to load correctly. I had been wondering if your web host is OK?
    Not that I’m complaining, but sluggish loading instances times
    will sometimes affect your placement in google and can damage your high-quality score
    if ads and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and could
    look out for much more of your respective fascinating content.
    Make sure you update this again soon.

  5. This website was… how do I say it? Relevant!! Finally I’ve found something that helped me.

    Thanks!

Leave a Comment