From 32fadb1e74d28a99d72d62fe29504a4ee08f321f Mon Sep 17 00:00:00 2001 From: BlueBell100 <143961249+BlueBell100@users.noreply.github.com> Date: Mon, 6 Nov 2023 22:25:13 +0000 Subject: [PATCH 1/2] Descriptive read me which outlines what needs to beintalled in order to use the program. --- Password-Generator/README.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Password-Generator/README.md b/Password-Generator/README.md index 5d6dc78..c914441 100644 --- a/Password-Generator/README.md +++ b/Password-Generator/README.md @@ -1,9 +1,25 @@ # Password-Generator ### A Password Generator program to test my learning - This is a simple program implemented in Python that will - generate a password for you. +Password Generator +This Python program is a simple password generator that allows users to create passwords of varying strength levels. The user can choose between 'weak,' 'medium,' or 'strong' passwords and specify the length and composition of the password. - You would have to choose the strength level of password. - Either a weak one a medium or a strong one. +How to Use: +Run the program, and you'll be prompted to select the desired password strength: 'weak,' 'medium,' or 'strong.' +Depending on your choice, you can customize your password as follows: + +Weak Password: Select the desired length for a password consisting of lowercase letters. +Medium Password: Specify the number of letters and digits in the password. +Strong Password: Choose the number of letters, digits, and special symbols in the password. +The program will generate the password according to your preferences and display it in red for easy visibility. + +If an invalid input is provided, the program will display a warning message. + +Dependencies: +This program uses the random module for generating passwords and the colorama library for adding color to the output. + +How to Run: +Ensure you have Python installed on your system, and install the required colorama library using the following command: + +pip install colorama \ No newline at end of file From 5fcf1a4744b26b966d78514b64c7033350ac7088 Mon Sep 17 00:00:00 2001 From: BlueBell100 <143961249+BlueBell100@users.noreply.github.com> Date: Tue, 7 Nov 2023 21:49:19 +0000 Subject: [PATCH 2/2] fixes problem #3 and shortens long list of letters in alphabet to one line of code --- Password-Generator/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Password-Generator/main.py b/Password-Generator/main.py index ae0d58b..5e53d61 100644 --- a/Password-Generator/main.py +++ b/Password-Generator/main.py @@ -22,6 +22,9 @@ def main(): def weak_password(): """This function will generate an weak password for you""" + letters= [chr(i) for i in range(ord('a'), ord('z') + 1)] + print(letters) + """ letters = [ "a", "b", @@ -51,6 +54,7 @@ def weak_password(): "y", "z", ] + """ 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))