Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import random
  2.  
  3. website = input("What website/service is this password for? ")
  4.  
  5. password = []
  6. stringbank = []
  7.  
  8. print("We'll now go over some questions to generate your new password.")
  9. answer1 = stringbank.append(str(input("What is the name of your middle school? ")).split())
  10. answer2 = stringbank.append(str(input("In which city were you born? ")).split())
  11. answer3 = stringbank.append(str(input("What is your favorite animal? ")).split())
  12.  
  13. length = input("Would you like a short, medium, or long password? ").lower()
  14.  
  15. def passwordgen(length):
  16. if length == 'short':
  17. while len(password) != 10:
  18. password.append(random.choice(stringbank))
  19. elif length == 'medium':
  20. while len(password) != 14:
  21. password.append(random.choice(stringbank))
  22. elif length == 'long':
  23. while len(password) != 18:
  24. password.append(random.choice(stringbank))
  25. return password
  26.  
  27. passwordgen(length)
  28.  
  29. password = "".join(password)
  30.  
  31. print("WEBSITE/SERVICE: " +website)
  32. print("PASSWORD: " +password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement