Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. from random import*
  2. from termcolor import colored
  3. a = int(input("Введите количество знаков в пароле (от 8 до 16 знаков): "))
  4. number = "0123456789"
  5. new_string = "qwertyuiopasdfghjklzxcvbnm"
  6. up_string = new_string.upper()
  7. password = number + new_string + up_string
  8. List = list(password)
  9. shuffle(List)
  10.  
  11. user_password = ''.join([choice(List) for x in range(a)])
  12.  
  13. if (a<8)or(a>16):
  14.   print(colored("Error", 'red'))
  15. else:
  16.   print(user_password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement