From fecb6951022e52f083d60e4f66094028fa45465b Mon Sep 17 00:00:00 2001 From: Soham Datta Date: Wed, 5 Oct 2022 18:02:56 +0530 Subject: [PATCH] Added random pass gen and resolved issue #615 --- Python/passwordGenerator.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Python/passwordGenerator.py diff --git a/Python/passwordGenerator.py b/Python/passwordGenerator.py new file mode 100644 index 00000000..8931f5a9 --- /dev/null +++ b/Python/passwordGenerator.py @@ -0,0 +1,7 @@ +import random +import string +print("Welcome to the Password Generator!") +total = string.ascii_letters + string.digits + string.punctuation +length = int(input("How many characters would you like in your password? ")) +password = "".join(random.sample(total, length)) +print(f"Your secure password is: {password}")