Cyberattacks are growing daily with current statistics stating that about 2,200 attacks are launched each day. That means every 39 seconds, the big bad hacker tries to get into your account.
Hackers mostly get into accounts by cracking the password as they leverage computer programs that are able to generate hundreds of password combinations within seconds. So, if you’re using a simple password, then it can be cracked instantly.
- Listing all character combinations that are allowed for passwords including letters, numbers, and symbols.
- Allowing users to customize the generated password by letting them choose how many letters, symbols, and numbers to include.
- Making it difficult to guess by arranging the characters in a random order.
Developing the random password generator
The above steps form a wireframe of the approach. However, the first step in learning Python programming for kids to code a random password generator is to write the Script.
Create a new file, main.py, to write the scripts for the app.
# main.py
letters = [
‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’,
‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘A’, ‘B’, ‘C’, ‘D’,
‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’,
‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’
]
numbers = [‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’]
symbols = [‘!’, ‘#’, ‘$’, ‘%’, ‘&’, ‘(‘, ‘)’, ‘*’, ‘+’]
print(“Welcome to the PyPassword Generator!”)
nr_letters = int(input(“How many letters would you like in your password?\n”))
nr_symbols = int(input(f”How many symbols would you like?\n”))
nr_numbers = int(input(f”How many numbers would you like?\n”))
The password generator shown in a list is composed of the characters from the code block above.
The next step is to ensure that users can input a figure, which is an integer that indicates how many times a character will appear in the final output that is declared with a variable and displayed.
n: Indicate that the value entered will be sent to the next line.
Let’s now update the remaining code. Use the undermentioned code for updating.

