| 26 | # chars_incl= characters that must be in password |
| 27 | # i= how many letters or characters the password length will be |
| 28 | def alternative_password_generator(chars_incl: str, i: int) -> str: |
| 29 | # Password Generator = full boot with random_number, random_letters, and |
| 30 | # random_character FUNCTIONS |
| 31 | # Put your code here... |
| 32 | i -= len(chars_incl) |
| 33 | quotient = i // 3 |
| 34 | remainder = i % 3 |
| 35 | # chars = chars_incl + random_letters(ascii_letters, i / 3 + remainder) + |
| 36 | # random_number(digits, i / 3) + random_characters(punctuation, i / 3) |
| 37 | chars = ( |
| 38 | chars_incl |
| 39 | + random(ascii_letters, quotient + remainder) |
| 40 | + random(digits, quotient) |
| 41 | + random(punctuation, quotient) |
| 42 | ) |
| 43 | list_of_chars = list(chars) |
| 44 | shuffle(list_of_chars) |
| 45 | return "".join(list_of_chars) |
| 46 | |
| 47 | # random is a generalised function for letters, characters and numbers |
| 48 | |
| 49 | |
| 50 | def random(chars_incl: str, i: int) -> str: |