Python Projects for Beginners: 25 Ideas With Source Code (2026)

Quick answer: Below are 25 Python projects for beginners. The first 10 come with short, tested source code that you can type and run in a few minutes – a number guessing game, calculator, password generator, quiz app, to-do list, expense tracker and more. The next 15 ideas (beginner and intermediate) list what to build, the free libraries to use and the skills you will learn.

Tip: do not just copy and paste. Type the code yourself, run it, then add the “Try next” feature under each project. That is how you actually learn Python – and it is what examiners and interviewers look for.

Contents

10 Python Projects for Beginners With Source Code

1. Number Guessing Game

You learn: loops, conditions, random numbers

import random

secret = random.randint(1, 100)
tries = 0
while True:
    guess = int(input("Guess a number (1-100): "))
    tries += 1
    if guess < secret:
        print("Too low")
    elif guess > secret:
        print("Too high")
    else:
        print(f"Correct! You took {tries} tries.")
        break
Try next: Limit the player to 7 tries and add a 'play again' option.

2. Simple Calculator

You learn: functions, user input, error handling

def calculate(a, op, b):
    if op == "+":
        return a + b
    if op == "-":
        return a - b
    if op == "*":
        return a * b
    if op == "/":
        if b == 0:
            return "Cannot divide by zero"
        return a / b
    return "Unknown operator"

a = float(input("First number: "))
op = input("Operator (+ - * /): ")
b = float(input("Second number: "))
print("Result:", calculate(a, op, b))
Try next: Add power and square-root options, and keep a history of results.

3. Strong Password Generator

You learn: strings, the secrets module, list comprehension

import secrets
import string

def make_password(length=12):
    chars = string.ascii_letters + string.digits + "!@#$%^&*"
    while True:
        pwd = "".join(secrets.choice(chars) for _ in range(length))
        # make sure it has at least one digit and one symbol
        if any(c.isdigit() for c in pwd) and any(c in "!@#$%^&*" for c in pwd):
            return pwd

print(make_password(16))
Try next: Let the user choose length and whether to include symbols.

4. Rock, Paper, Scissors

You learn: dictionaries, random choice, game logic

import random

choices = ["rock", "paper", "scissors"]
beats = {"rock": "scissors", "paper": "rock", "scissors": "paper"}

user = input("rock, paper or scissors? ").lower()
computer = random.choice(choices)
print("Computer chose:", computer)

if user not in choices:
    print("Invalid choice")
elif user == computer:
    print("It's a draw")
elif beats[user] == computer:
    print("You win!")
else:
    print("You lose")
Try next: Play best of five and keep score.

5. Quiz App

You learn: lists of tuples, loops, scoring

questions = [
    ("What is the output of 2 ** 3?", "8"),
    ("Which keyword defines a function in Python?", "def"),
    ("What data type is [1, 2, 3]?", "list"),
]

score = 0
for q, answer in questions:
    reply = input(q + " ").strip().lower()
    if reply == answer:
        print("Correct!")
        score += 1
    else:
        print("Wrong. Answer:", answer)

print(f"Your score: {score}/{len(questions)}")
Try next: Load questions from a CSV file and shuffle them.

6. Unit Converter

You learn: functions as values, dictionaries, formatting

def c_to_f(c):
    return c * 9 / 5 + 32

def km_to_miles(km):
    return km * 0.621371

def kg_to_lb(kg):
    return kg * 2.20462

options = {"1": ("Celsius to Fahrenheit", c_to_f),
           "2": ("Kilometres to miles", km_to_miles),
           "3": ("Kilograms to pounds", kg_to_lb)}

for key, (name, _) in options.items():
    print(key, name)
choice = input("Choose 1-3: ")
value = float(input("Enter value: "))
name, func = options[choice]
print(f"{name}: {func(value):.2f}")
Try next: Add more units and convert in both directions.

7. BMI Calculator

You learn: arithmetic, if–elif chains, f-strings

weight = float(input("Weight in kg: "))
height = float(input("Height in metres: "))
bmi = weight / height ** 2

if bmi < 18.5:
    status = "Underweight"
elif bmi < 25:
    status = "Normal"
elif bmi < 30:
    status = "Overweight"
else:
    status = "Obese"

print(f"BMI = {bmi:.1f} ({status})")
Try next: Build a small Tkinter window for it.

8. To-Do List with File Saving

You learn: lists of dictionaries, JSON files

import json, os

FILE = "tasks.json"
tasks = json.load(open(FILE)) if os.path.exists(FILE) else []

while True:
    cmd = input("add / list / done / quit: ").strip().lower()
    if cmd == "add":
        tasks.append({"task": input("Task: "), "done": False})
    elif cmd == "list":
        for i, t in enumerate(tasks, 1):
            print(i, "[x]" if t["done"] else "[ ]", t["task"])
    elif cmd == "done":
        n = int(input("Task number: "))
        tasks[n - 1]["done"] = True
    elif cmd == "quit":
        break
    json.dump(tasks, open(FILE, "w"), indent=2)
Try next: Add due dates and sort tasks by date.

9. Word Counter and Frequency Finder

You learn: file reading, regex, collections.Counter

from collections import Counter
import re

text = open("sample.txt", encoding="utf-8").read().lower()
words = re.findall(r"[a-z']+", text)

print("Total words:", len(words))
print("Unique words:", len(set(words)))
print("Top 10 words:")
for word, count in Counter(words).most_common(10):
    print(f"  {word}: {count}")
Try next: Plot the top words as a bar chart with Matplotlib.

10. Expense Tracker (CSV)

You learn: CSV files, dates, defaultdict

import csv
from collections import defaultdict
from datetime import date

FILE = "expenses.csv"

def add_expense(category, amount):
    with open(FILE, "a", newline="") as f:
        csv.writer(f).writerow([date.today(), category, amount])

def summary():
    totals = defaultdict(float)
    with open(FILE) as f:
        for _, category, amount in csv.reader(f):
            totals[category] += float(amount)
    for category, total in sorted(totals.items()):
        print(f"{category:<12} Rs {total:,.2f}")

add_expense("food", 250)
add_expense("travel", 120)
summary()
Try next: Add a monthly summary and a pie chart of categories.

Beginner Python Project Ideas

11. Digital Clock and Stopwatch

A Tkinter window that shows the time and works as a stopwatch.

Free tools: Tkinter, time
You learn: GUI basics, event loop

12. Dice Rolling Simulator

Roll one or more dice and show how often each number appears.

Free tools: random, Matplotlib
You learn: Probability, plotting

13. Hangman Game

Guess the word letter by letter with a limited number of lives.

Free tools: Python standard library
You learn: Strings, sets, loops

14. Tip and Bill Splitter

Split a restaurant bill between friends, with tip and rounding.

Free tools: Python
You learn: Arithmetic, input validation

15. Countdown Timer and Alarm

Set a timer and play a sound when it finishes.

Free tools: time, playsound or winsound
You learn: Loops, modules

16. Contact Book

Add, search, edit and delete contacts stored in a file.

Free tools: json or sqlite3
You learn: CRUD operations

17. QR Code Generator

Turn any text or link into a QR code image.

Free tools: qrcode, Pillow
You learn: Using third-party libraries

Intermediate Python Project Ideas

18. Weather App

Show the current weather for a city using a free weather API.

Free tools: requests, free OpenWeather API key
You learn: APIs, JSON

19. Web Scraper for Job or Book Listings

Collect titles and prices from a practice site such as books.toscrape.com and save to CSV.

Free tools: requests, BeautifulSoup, pandas
You learn: Web scraping, data cleaning

20. Student Marks Analyser

Read marks from Excel, find averages and toppers, and plot results.

Free tools: pandas, Matplotlib
You learn: Data analysis

21. Library Management System

Issue and return books with due dates and fines.

Free tools: sqlite3, Tkinter
You learn: Databases, GUI

22. Snake Game

Classic snake game with score and increasing speed.

Free tools: Pygame
You learn: Game loop, collision detection

23. PDF Merger and Splitter

Merge several PDFs or extract pages from one.

Free tools: pypdf
You learn: File handling, automation

24. Automatic File Organiser

Sort files in your Downloads folder into folders by type.

Free tools: os, shutil, pathlib
You learn: Automation, file system

25. Personal Portfolio Website

A small website about you built with a Python web framework.

Free tools: Flask, HTML, CSS
You learn: Web development basics

How to Run These Python Projects

  1. Install Python 3 from python.org (tick “Add Python to PATH” on Windows).
  2. Install a free editor such as VS Code and its Python extension.
  3. Create a file such as game.py, paste or type the code and save it.
  4. Run it from the terminal with python game.py.
  5. For projects that use extra libraries, install them first, for example pip install pandas matplotlib.

No laptop set-up? Most console projects also run in Google Colab in your browser.

What to Build Next

Want to build it with a mentor? We teach Python, DSA, machine learning and cyber security through live online classes arranged around your free time – you write and understand every line yourself. Message us on WhatsApp or email engineersrworld@gmail.com.

Frequently Asked Questions

Which Python project is best for beginners?

Start with small console projects such as a number guessing game, calculator, quiz app or to-do list. They use only core Python and teach loops, conditions, functions and files – the base for every bigger project.

Do I need to install anything to run these Python projects?

Install Python 3 from python.org and a free editor such as VS Code. You can also run most console projects online in Google Colab without installing anything.

Can I copy the source code for my college project?

Use the code to learn, then type it yourself, change it and add the 'try next' features. Examiners ask you to explain your code, so a project you understand and extend is far more valuable than copied code.

How long does a beginner Python project take?

Most projects with code here take 1–3 hours. The intermediate ideas take 1–2 weeks, depending on the features you add.

What should I build after these beginner projects?

Move to data analysis with pandas, a small Flask web app, then machine learning projects. Our Python roadmap and final year project lists show the next steps.

Next step: Explore AI projects for students and 100 Python MCQs.

Scroll to Top