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