mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 21:41:08 +00:00
4adf3b9492
Without these changes, Python syntax errors are raised. flake8 should be run by this repo's .travis.yml file but it is currently turned off.
36 lines
1004 B
Python
36 lines
1004 B
Python
from __future__ import print_function
|
|
import string
|
|
import random
|
|
|
|
letters = [letter for letter in string.ascii_letters]
|
|
digits = [digit for digit in string.digits]
|
|
symbols = [symbol for symbol in string.punctuation]
|
|
chars = letters + digits + symbols
|
|
random.shuffle(chars)
|
|
|
|
min_length = 8
|
|
max_length = 16
|
|
password = ''.join(random.choice(chars) for x in range(random.randint(min_length, max_length)))
|
|
print('Password: ' + password)
|
|
print('[ If you are thinking of using this passsword, You better save it. ]')
|
|
|
|
|
|
# ALTERNATIVE METHODS
|
|
# ctbi= characters that must be in password
|
|
# i= how many letters or characters the password length will be
|
|
def password_generator(ctbi, i):
|
|
# Password generator = full boot with random_number, random_letters, and random_character FUNCTIONS
|
|
pass # Put your code here...
|
|
|
|
|
|
def random_number(ctbi, i):
|
|
pass # Put your code here...
|
|
|
|
|
|
def random_letters(ctbi, i):
|
|
pass # Put your code here...
|
|
|
|
|
|
def random_characters(ctbi, i):
|
|
pass # Put your code here...
|