Back to Portfolio

Python Mini Projects 🐍

A collection of useful scripts and automation tools.

🎬 YouTube Video Downloader

Automation

A simple script to download high-quality videos from YouTube using the pytube library. Just paste the URL and let Python handle the rest!

from pytube import YouTube

def download_video(url):
    yt = YouTube(url)
    stream = yt.streams.get_highest_resolution()
    stream.download()
    print("Download Completed!")

# Example Usage
url = "https://youtu.be/dQw4w9WgXcQ"
download_video(url)

🔐 Secure Password Generator

Security

Generate strong, random passwords with customizable length, numbers, and symbols. Essential for cybersecurity enthusiasts.

import random, string

def generate_password(length=12):
    chars = string.ascii_letters + string.digits + "!@#$%"
    password = "".join(random.choice(chars) for _ in range(length))
    return password

# Generate a strong password
print("Your Password:", generate_password(16))

🧠 GK Quiz Application

Interactive

A command-line based interactive General Knowledge quiz with multiple choice questions, score tracking, and instant feedback. Perfect for testing your specific knowledge!

def run_quiz():
    score = 0
    questions = [
        {"q": "What is the capital of France?", "opt": ["A. Paris", "B. Rome"], "ans": "A"},
        {"q": "Who wrote 'Hamlet'?", "opt": ["A. Dickens", "B. Shakespeare"], "ans": "B"}
    ]

    for q in questions:
        print(q["q"])
        for o in q["opt"]: print(o)
        ans = input("Enter Choice (A/B): ").upper()
        if ans == q["ans"]:
            print("Correct! ✅")
            score += 1
        else: print("Wrong! ❌")

    print(f"Final Score: {score}/{len(questions)}")