Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 7 additions & 106 deletions Password-Generator/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" The random module help us get random values of our choice """
import random
import string
from colorama import Fore


Expand All @@ -22,72 +23,16 @@ def main():

def weak_password():
"""This function will generate an weak password for you"""
letters = [
"a",
"b",
"c",
"d",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
letters = list(string.ascii_letters)
user_choice = int(input("How long you need your password to be: "))
password = random.choices(letters, k=user_choice)
print("Here is your password: " + Fore.RED + "".join(password))


def medium_password():
"""This function will generate a medium password for you"""
letters = [
"a",
"b",
"c",
"d",
"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"]
letters = list(string.ascii_letters)
numbers = list(string.digits)
letter_choice = int(input("How much letters do you want in your password: "))
number_choice = int(input("How much numbers do you want in your password: "))
letter_password = random.choices(letters, k=letter_choice)
Expand All @@ -99,53 +44,9 @@ def medium_password():

def strong_password():
"""This function will generate a strong password for you"""
letters = [
"a",
"b",
"c",
"d",
"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 = [
"~",
"@",
"#",
"$",
"%",
"^",
"&",
"*",
"(",
")",
"?",
"/",
"<",
">",
"|",
]
letters = list(string.ascii_letters)
numbers = list(string.digits)
symbols = list(string.punctuation)

letter_choice = int(input("How much letters do you want in your password: "))
number_choice = int(input("How much numbers do you want in your password: "))
Expand Down