Skip to content
Home/Resources/Projects/Python projects
Project guide · Python

Python Projects for Beginners: 32 Ideas From a Guessing Game to a Deployed App, With Starter Code

By Younus FardeenUpdated 4 Nov 20266 min read
Short answer

The best Python projects for beginners are small and finished: a guessing game, a password generator, a terminal to-do list, a file organiser, a weather command-line tool, a Flask or FastAPI app and a first machine learning model on a public dataset. Build one from each group below, add the stand-out upgrade, push it to GitHub with a README and deploy anything that runs on the web.

Pick something you would actually use. Each idea below names the data it needs and an upgrade that makes it portfolio-worthy. Starter code for four of them is at the end, and every sample was run before it was published.

Brand new to Python?Guessing game, password generator and to-do list, in that order.
Want a portfolio project?URL shortener or REST API with FastAPI, with tests and a live link.
Interested in data?Spam classifier or movie recommender, then the AI project ideas.
  1. 1Pickone small idea
  2. 2Planinputs, outputs, rules
  3. 3Buildthe simplest version
  4. 4Testbreak it on purpose
  5. 5ShareGitHub README, live link
Every project below follows this loop. Finishing and sharing matter more than size.

First scripts (a weekend each)

Number guessing game

Beginner

Python, random

DataNone

Stand-outCount the tries and add a binary-search hint mode

Password generator

Beginner

secrets, string

DataNone

Stand-outGuarantee each character type and test it over 1,000 runs

To-do list in the terminal

Beginner

json, argparse

DataNone

Stand-outSave to a file and add due dates

Unit and currency converter

Beginner

requests

DataFrankfurter exchange rates (free, no key)

Stand-outCache the last rates so it works offline

Quiz game from a JSON file

Beginner

json, random

DataYour own questions

Stand-outA score history for each player

Rock paper scissors against a learning bot

Beginner

random

DataNone

Stand-outShow the win rate over 100 rounds against each strategy

Word frequency counter

Beginner

collections.Counter

DataAny public-domain book as a text file

Stand-outRemove stop words and chart the top 20

Expense tracker

Beginner

csv, collections

DataYour own spending

Stand-outA monthly summary by category with a chart

Automation and files

File organiser

Beginner

pathlib, shutil

DataYour Downloads folder

Stand-outA dry-run mode and an undo log

Bulk file renamer

Beginner

pathlib, regex

DataYour own files

Stand-outA preview before anything is renamed

PDF merger and splitter

Beginner

pypdf

DataYour own PDFs

Stand-outA command-line interface with page ranges

Weather command-line tool

Beginner

requests

DataOpen-Meteo forecast API (free, no key)

Stand-outRetries on errors and a five-day table

Daily email digest

Intermediate

smtplib, schedule

DataAn RSS feed you choose

Stand-outAn unsubscribe line and a send log, tested with a throwaway account

Folder watcher that sorts new files

Intermediate

watchdog

DataA local folder

Stand-outHandles half-downloaded files safely

Web apps and APIs

URL shortener

Intermediate

Flask or FastAPI, SQLite

DataNone

Stand-outClick counts and collision-safe short codes

Personal blog

Intermediate

Flask, SQLite

DataYour own posts

Stand-outLogin, drafts and Markdown rendering

REST API for a notes app

Intermediate

FastAPI, pytest

DataYour own schema

Stand-outAutomatic docs and tests for every route

Library search app

Beginner

Flask or Streamlit

DataOpen Library search API (free, no key)

Stand-outPagination and a reading list

Telegram bot

Intermediate

python-telegram-bot

DataYour own commands

Stand-outRate limiting and a /help command

Price tracker for one product

Intermediate

requests, BeautifulSoup

DataA page whose terms allow it

Stand-outRespects robots.txt and waits politely between requests

Streamlit dashboard

Beginner

Streamlit, pandas

DataAny open dataset

Stand-outDeployed free on Streamlit Community Cloud

Data and machine learning

Analyse your own data export

Beginner

pandas, matplotlib

DataYour Google Takeout or phone screen-time export

Stand-outOne chart that surprised you, with the code

Titanic survival predictor

Beginner

scikit-learn

DataThe Kaggle Titanic competition data

Stand-outCompare three models and explain which features matter

Spam message classifier

Intermediate

scikit-learn

DataUCI SMS Spam Collection

Stand-outReport precision and recall, not only accuracy

Movie recommender

Intermediate

pandas, scikit-learn

DataMovieLens dataset

Stand-outA plan for new users who have no ratings yet

House price regression

Beginner

scikit-learn

DataCalifornia housing (built into scikit-learn)

Stand-outCross-validation and error by region

Web scraper for practice

Beginner

requests, BeautifulSoup

Databooks.toscrape.com, a site made for scraping practice

Stand-outSaves to CSV and follows the pagination

Games and algorithms

Hangman

Beginner

Python

DataA word list

Stand-outDifficulty levels based on word length

Tic-tac-toe with an unbeatable computer player

Intermediate

Python, minimax

DataNone

Stand-outAlpha-beta pruning and a comparison of positions searched

Snake game

Intermediate

pygame

DataNone

Stand-outA saved high-score table

Sudoku solver

Intermediate

Python, backtracking

DataPuzzles you type or load

Stand-outTiming on easy and hard boards

Maze generator and solver

Intermediate

Python, BFS and DFS

DataNone

Stand-outAnimate the search and compare BFS with DFS

Starter code: password generator

Uses secrets, which is meant for security, not random. It keeps generating until all four character types appear.

import secrets, string

def make_password(length=14):
    symbols = "!@#$%&*"
    alphabet = string.ascii_letters + string.digits + symbols
    while True:
        password = "".join(secrets.choice(alphabet) for _ in range(length))
        if (any(c.islower() for c in password) and any(c.isupper() for c in password)
                and any(c.isdigit() for c in password) and any(c in symbols for c in password)):
            return password

pw = make_password()
print(len(pw), any(c.isdigit() for c in pw))

Output: 14 True

Starter code: guessing game logic

Keep the rules in a small function so you can test them without typing guesses.

import random

def check_guess(secret, guess):
    if guess < secret:
        return "too low"
    if guess > secret:
        return "too high"
    return "correct"

def play(low=1, high=100):
    secret, tries = random.randint(low, high), 0
    while True:
        tries += 1
        result = check_guess(secret, int(input(f"Guess a number {low}-{high}: ")))
        print(result)
        if result == "correct":
            print(f"You won in {tries} tries")
            return

print(check_guess(42, 30), check_guess(42, 50), check_guess(42, 42))
# call play() to run the game

Output: too low too high correct

Starter code: to-do list core

import json
from pathlib import Path

def add_task(tasks, text):
    tasks.append({"text": text, "done": False})

def complete_task(tasks, index):
    tasks[index]["done"] = True

def save(tasks, path="todo.json"):
    Path(path).write_text(json.dumps(tasks, indent=2))

def load(path="todo.json"):
    p = Path(path)
    return json.loads(p.read_text()) if p.exists() else []

tasks = []
add_task(tasks, "Revise recursion")
add_task(tasks, "Push project to GitHub")
complete_task(tasks, 0)
for i, task in enumerate(tasks, 1):
    print(i, "[x]" if task["done"] else "[ ]", task["text"])

Output: 1 [x] Revise recursion and 2 [ ] Push project to GitHub. Add argparse for commands and the save and load functions for a real app.

Starter code: expense summary

from collections import defaultdict

expenses = [("food", 180), ("travel", 60), ("food", 220), ("books", 450), ("travel", 40)]
totals = defaultdict(int)
for category, amount in expenses:
    totals[category] += amount

for category, total in sorted(totals.items(), key=lambda item: -item[1]):
    print(f"{category:<8}{total:>6}")
print("total", sum(totals.values()))

Output: books 450, food 400, travel 100, total 950

Turn any idea into a portfolio piece

  1. Pick one idea and write the one-line goal first.
  2. Build the smallest version that works end to end.
  3. Add tests for the rules that could silently break.
  4. Deploy it so there is a live link or a one-command run.
  5. Write the README: what it does, how to run it, one number, one limit.

Frequently asked questions

Which Python project should a beginner start with?

A number guessing game or a password generator. Both need only the standard library, and you can finish them in an evening.

How many Python projects do I need for a resume?

Two or three finished projects with a README and a live link or a one-command run beat ten half-finished ones. Include one that uses data or an API.

Where can I find Python projects with source code?

Study maintained open-source repositories on the projects with source code page, then change them: add tests, swap the database or add a feature.

Which Python projects get you a job?

Projects that are deployed, tested and documented: an API with tests, a web app with a database, and a data project with a clear question and a measured result.

Do I need to know a framework before I start?

No. Start with scripts in plain Python, then add Flask or FastAPI when you want a web app.

Learn this with mentors

Programmes for builders and engineers with admissions open: live classes, mentors and project work.

Continue learning

Project guide · Software

Software projects

Full-stack apps with auth, tests, real-time features and CI.

Open guide →23 ideas
Project guide · Python

Python data projects

15 pandas, time-series and scraping projects on real data.

Open guide →15 ideas
Source code

Free projects with source code

28 maintained repositories to clone, run and change.

Browse the repositories →30 repos