Created
May 19, 2022 11:43
-
-
Save harendra21/2218e741ee7965a0d82ace0f8b75a34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import choice | |
from string import printable | |
def random_password(length): | |
""" | |
Provides a random password of the given length. | |
:param int length: The length of the password to generate. | |
""" | |
return "".join([choice(printable) for x in range(int(length))]) | |
if __name__ == "__main__": | |
amount = int(input("How many passwords: ")) | |
number = int(input("Length of password? ")) | |
for i in range(1, amount + 1): | |
print(f" Password: {i} - {repr(random_password(number))} ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment