Skip to content

Instantly share code, notes, and snippets.

@OmaymaS
Created September 17, 2021 23:33
Show Gist options
  • Save OmaymaS/eaaaaa137d50a46a86dd1749dd8f3f00 to your computer and use it in GitHub Desktop.
Save OmaymaS/eaaaaa137d50a46a86dd1749dd8f3f00 to your computer and use it in GitHub Desktop.
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
letter_pwd = random.sample(letters, 3)
symbols_pwd = random.sample(symbols, 3)
numbers_pwd = random.sample(numbers, 3)
password_list = letter_pwd + symbols_pwd + numbers_pwd
random.shuffle(password_list)
''.join(password_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment