Skip to content

Random password generator on python #2121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Sibiraj
  • Loading branch information
Sibiraj20 committed Jan 31, 2024
commit 20682b3d11b6947aa437472d60a49df02a655b98
12 changes: 12 additions & 0 deletions currency converter/import random.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import random
import string

def generate_password(length=12):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password

if __name__ == "__main__":
password_length = int(input("Enter the desired password length: "))
generated_password = generate_password(password_length)
print("Your generated password is:", generated_password)
12 changes: 12 additions & 0 deletions random pass generator .py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import random
import string

def generate_password(length=12):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password

if __name__ == "__main__":
password_length = int(input("Enter the desired password length: "))
generated_password = generate_password(password_length)
print("Your generated password is:", generated_password)