From 56c99d8f3ce683de0ee36a9213726d0dbea24db9 Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Tue, 20 Jul 2021 16:45:19 +0530 Subject: [PATCH] Improved code Nice project @varunherlekar. Still, there are some improvements which I've made. Some codes were ambiguous like importing unnecessary modules and print statements. Also, you can add some more functionality like if the user needs numbers or alphabets or other signs. It will be hard for the user itself to remember the password rather than a hacker to crack it. --- keypass.py | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/keypass.py b/keypass.py index 3c08e46..b4a920a 100644 --- a/keypass.py +++ b/keypass.py @@ -1,29 +1,13 @@ -import random, os, sys - -print ("STRONG PASSWORD GENERATOR") -print (" ") -print ("Tool By www.github.com/varunherlekar") - -print (" ") +import random +print ("STRONG PASSWORD GENERATOR\n") +print ("Tool By www.github.com/varunherlekar\n") print ("<===[[ coded by Varun Herlekar]]===>") -print (" ") - - -length=int(input("Enter The Length Of The Password: ")) -print (" ") -print ("-----> Your Password Is Generated <----") -print (" ") +length=int(input("Enter The Length Of The Password: \n")) +print ("-----> Your Password Is Generated <----\n") char="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890@#$%&*^" -password= (" ") -for i in range(length): - - password+=random.choice(char) - +password = "".join(random.choices(char,k=length)) print(password) -print (" ") -print ("-----> Copy The Password. Thank You For Using .<----") -print ("-----> Tool Created For WAP STTP Program.<----") -print (" ") - +print ("-----> Copy The Password. Thank You For Using .<----\n") +print ("-----> Tool Created For WAP STTP Program.<----\n")