Advertisement
Guest User

sdgsdf

a guest
Feb 26th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 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.extend(str(input("What is the name of your middle school? ")).replace(" ", ""))
  10. answer2 = stringbank.extend(str(input("In which city were you born? ")).replace(" ", ""))
  11. answer3 = stringbank.extend(str(input("What is your favorite animal? ")).replace(" ", ""))
  12.  
  13. length = input("Would you like a short, medium, or long password? ").lower()
  14. stringbank = "".join(stringbank)
  15.  
  16. def passwordgen(length):
  17. if length == 'short':
  18. while len(password) != 10:
  19. password.append(random.choice(stringbank))
  20. elif length == 'medium':
  21. while len(password) != 14:
  22. password.append(random.choice(stringbank))
  23. elif length == 'long':
  24. while len(password) != 18:
  25. password.append(random.choice(stringbank))
  26. return password
  27.  
  28. passwordgen(length)
  29.  
  30. password = "".join(password)
  31.  
  32. print("WEBSITE/SERVICE: " +website)
  33. print("PASSWORD: " +password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement