Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import _random
- print("Heloo!")
- username = input("Please select your username: ")
- print (username,", Please select how strong do you want your password to be.")
- print ("For weak password type 'W' :\nFor medium password type 'M':\nFor strong password type 'S' ")
- strength = input("My choice is: ")
- w = "abcdefghijklmnopqrstuwvxyz"
- m = "abcdefghijklmnopqrstuwvxyz0123456789"
- s = "abcdefghijklmnopqrstuwvxyz0123456789!@#$%^&*()_+-/"
- def passwordform():
- import random
- if strength == 'W':
- passwordlen = 6
- password = ''.join(random.sample(w,passwordlen))
- elif strength == 'M':
- passwordlen = 9
- password = ''.join(random.sample(m, passwordlen))
- elif strength == 'S':
- passwordlen = 12
- password = ''.join(random.sample(s, passwordlen))
- return password
- print("Your password is: ", passwordform())
- else:
- print ("Greska pri unosu ! Pazite na veliko slovo!")
- print("Your password is: ", passwordform())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement