From 93ec0f7ea8bf82f6e3c7918f8cf7682ea2e4cf6e Mon Sep 17 00:00:00 2001 From: Sumalya Chatterjee <105884682+R3DHULK@users.noreply.github.com> Date: Mon, 21 Nov 2022 16:56:17 +0000 Subject: [PATCH] password generator --- random-pass-gen.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 random-pass-gen.py diff --git a/random-pass-gen.py b/random-pass-gen.py new file mode 100644 index 0000000..0bd1ff8 --- /dev/null +++ b/random-pass-gen.py @@ -0,0 +1,47 @@ +import string,random + +def generate(n): + + """ + This function will take n as password length then generate final string which has letters,digits and puntuation + then convert that string into list + then uses random.shuffle to shuffle that list + initiale another list in which we store our password + then iterate a loop to password length so it can save characters through random.choice in pw_list + shuffle pw_list for more randomness + converts pw_list into string password. + """ + + s1 = str(input("\033[92m [*] Enter Name : ")) + s2=str(input("\033[92m [*] Enter Name : ")) + s3=str(input("\033[92m [*] Enter Name : ")) + + final = s1+s2+s3 + + l1 = list(final) + random.shuffle(l1) + + pw_list = [] + + i=0 + while i