#4 Password generator
Password generator
This programme will give you a strong password every time when you need and its also remember your passwords in a file and when you forget you can also check it from your file. This programme will suggest such types of passwords which are not hackable.
Please make a text file password.txt in you directory to run this programme
Code for software
***************************
import string
import random as r
ls = []
s1 = string.ascii_uppercase
s2 = string.ascii_lowercase
s3 = string.digits
s4 = string.punctuation
def random_choice(value):
choice = r.choice(value)
ls.append(choice)
return ls
for i in range(2):
random_choice(s1)
random_choice(s2)
random_choice(s3)
random_choice(s4)
final_password = ''
r.shuffle(ls)
for items in ls:
final_password +=items
with open('password.txt','a') as passfile:
passfile.write(final_password+'\n')
print(final_password)
***************************
Comments
Post a Comment