Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions Domains/cli/MiniProjects/RandomPasswordGenerator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Random Password Generator

A simple command-line tool to generate secure random passwords in Python.

## Features
- Customizable password length
- Options to include uppercase, digits, and symbols
- Easy to use and extend

## How to Run
1. Make sure you have Python installed.
2. Navigate to this folder in your terminal.
3. Run:
```bash
python password_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import random
import string

def generate_password(length=12, include_uppercase=True, include_digits=True, include_symbols=True):
"""Generate a random secure password."""
characters = string.ascii_lowercase
if include_uppercase:
characters += string.ascii_uppercase
if include_digits:
characters += string.digits
if include_symbols:
characters += string.punctuation

if not characters:
raise ValueError("At least one character type must be selected.")

password = ''.join(random.choice(characters) for _ in range(length))
return password

if __name__ == "__main__":
print("Random Password Generator")
print("-" * 25)
pwd = generate_password()
print(f"Generated Password: {pwd}")
Loading