From 6e126cb9bc796975f4c2de414204948008e68586 Mon Sep 17 00:00:00 2001 From: chhatrapalsinhzala7 Date: Sat, 2 Oct 2021 16:09:20 +0530 Subject: [PATCH 1/2] Random Password Generator Using Python hello sir i am contributing this under hecktoberfest 2021 so please assign me a hacktoberfest 2021 label. --- .DS_Store | Bin 0 -> 6148 bytes Python/Random-password.py | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .DS_Store create mode 100644 Python/Random-password.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..14f2f8d4e236f40e591ef0cc9d2472ce66116fbe GIT binary patch literal 6148 zcmeHK%Wl&^6ur}g)(OyNfmAj~-mq#~rL;w2ft2O}3Mx?50TzH-=K+my>?(E|N(joH zAAk+Nz;Eyed!gr`=TuRdb`6GoCs3dgl1rlOZBe8Fto*3Pfa~FlO_p&M+S5 zGGlYPhnX>#gnS~fj>%2(q>^#o0_{M#D%GK$L-iD!m5a0IX&0-H zFo%Hr6qofom)jbJNBX<|qjlutT5y94Rm>vTbR^`hr@f>9+H`khe5anyii<*eL( zVR<}W-74A}Tct_S9^boDD%zVHcPEpawS0U1e&e8j@?rdO^63lK0~6Srq%CPYg|BEN z^f-0~z8CoX`1SXU#P`L_y#1P6I{kGOcM|&WA@rSvKA{MCcf_|PokUrosf_|g zfusT%by?v3zkdGtKj~zyi~>f1OQnFw)|^@eOVWGm%;I>jwNVaG*qAp}C|ywL?N~N= fE53;$4P!PpfMtzSh3J8qKLSz)QyB&RsRDlhHy#Ll literal 0 HcmV?d00001 diff --git a/Python/Random-password.py b/Python/Random-password.py new file mode 100644 index 00000000..d5d7e2dc --- /dev/null +++ b/Python/Random-password.py @@ -0,0 +1,54 @@ +import string +import random + + +alphabets = list(string.ascii_letters) +digits = list(string.digits) +special_characters = list("!@#$%^&*()") +characters = list(string.ascii_letters + string.digits + "!@#$%^&*()") + +def generate_random_password(): + length = int(input("Enter The Length Of Password: ")) + + alphabets_count = int(input("How Many Alphabets You Want : ")) + digits_count = int(input("How Many Digits You Want : ")) + special_characters_count = int(input("How Many Special Character You Want: ")) + + characters_count = alphabets_count + digits_count + special_characters_count + + + if characters_count > length: + print("Characters total count is greater than the password length") + return + + + password = [] + + for i in range(alphabets_count): + password.append(random.choice(alphabets)) + + + for i in range(digits_count): + password.append(random.choice(digits)) + + + for i in range(special_characters_count): + password.append(random.choice(special_characters)) + + + + if characters_count < length: + random.shuffle(characters) + for i in range(length - characters_count): + password.append(random.choice(characters)) + + + + random.shuffle(password) + + + print("".join(password)) + + + +generate_random_password() \ No newline at end of file From 52c5e8a5ab3e0dce530d9e4fada77ccf9c4b3617 Mon Sep 17 00:00:00 2001 From: chhatrapalsinhzala7 Date: Sun, 3 Oct 2021 16:28:10 +0530 Subject: [PATCH 2/2] Update .DS_Store --- .DS_Store | Bin 6148 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.DS_Store b/.DS_Store index 14f2f8d4e236f40e591ef0cc9d2472ce66116fbe..de60712c8e2c4bb5bfc3a35532636d18fd591b95 100644 GIT binary patch delta 20 bcmZoMXffDun2p`sLPx>S#BB2^HY-5@MA8Ng delta 20 bcmZoMXffDun2lZ6R7b(s)L`=|HY-5@L@WjU