Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.32 KB | None | 0 0
  1. from random import*
  2. class colors:
  3.     end='\033[0m'
  4.     underline='\033[04m'
  5.     class fg:
  6.         red='\033[31m'
  7.         green='\033[32m'
  8. a = int(input("Введите количество знаков в пароле "+colors.fg.green+"(от 8 до 16 знаков)"+colors.end+":"))
  9. print(" ")
  10. number = "0123456789"
  11. new_string = "qwertyuiopasdfghjklzxcvbnm"
  12. up_string = new_string.upper()
  13. new_russian = "йцукенгшщзхъфывапролджэячсмитьбю"
  14. up_russian = new_russian.upper()
  15. symbols = "!@#$%^&*()-_=+"
  16. password = number + new_string + up_string + new_russian + up_russian + symbols
  17. List = list(password)
  18. shuffle(List)
  19.  
  20. user_password = ''.join([choice(List) for x in range(a)])
  21.  
  22. if (a<8)or(a>16):
  23.   print(colors.fg.red + "Error" + colors.end)
  24. else:
  25.   print(colors.fg.green + "Ваш пароль: " + colors.end + user_password)
  26.   print(colors.fg.red + colors.underline + "ПРИМЕЧАНИЕ" + colors.end + colors.fg.red + ": " + colors.end + colors.fg.red + colors.underline + "Сохраните данный пароль в надежное место, и никому его не сообщайте." + colors.end)
  27.   print(" ")
  28.   print(colors.fg.green+"Если вам НЕ нравится этот пароль - вы можете перезапустить программу."+colors.end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement