Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import random
  2.  
  3. P = 10**(-7)
  4. V = 3*60*24*30
  5. T = 1
  6. S_= (V*T)/P
  7. A = 43
  8. L = 8
  9.  
  10. #print(S_)
  11. #print(69**8)
  12.  
  13. password = []
  14.  
  15. def gen(password):
  16. for i in range(L):
  17. c = random.randint(1, 4)
  18. if c == 1:
  19. c2 = random.randint(65, 90)
  20. password.append(chr(c2))
  21. if c == 2:
  22. c2 = random.randint(97, 122)
  23. password.append(chr(c2))
  24. if c == 3:
  25. c2 = random.randint(48, 57)
  26. password.append(chr(c2))
  27. if c == 4:
  28. c2 = random.randint(33, 39)
  29. password.append(chr(c2))
  30.  
  31. def pas():
  32. w = input("Сгенерировать пароль? (да/нет) ")
  33. if w == "да":
  34. password.clear()
  35. gen(password)
  36. z = ''.join(password)
  37. print("Сгенерированный пароль: ", z)
  38. return pas()
  39. if w == "нет":
  40. exit()
  41.  
  42. pas()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement