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 with source code
- Beginner project ideas
- Intermediate project ideas
- How to run these projects
- What to build next
- FAQs
10 Python Projects for Beginners With Source Code
1. Number Guessing Game
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.")
break2. Simple Calculator
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))3. Strong Password Generator
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))4. Rock, Paper, Scissors
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")5. Quiz App
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)}")6. Unit Converter
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}")7. BMI Calculator
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})")8. To-Do List with File Saving
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)9. Word Counter and Frequency Finder
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}")10. Expense Tracker (CSV)
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()Beginner Python Project Ideas
11. Digital Clock and Stopwatch
A Tkinter window that shows the time and works as a stopwatch.
12. Dice Rolling Simulator
Roll one or more dice and show how often each number appears.
13. Hangman Game
Guess the word letter by letter with a limited number of lives.
14. Tip and Bill Splitter
Split a restaurant bill between friends, with tip and rounding.
15. Countdown Timer and Alarm
Set a timer and play a sound when it finishes.
16. Contact Book
Add, search, edit and delete contacts stored in a file.
17. QR Code Generator
Turn any text or link into a QR code image.
Intermediate Python Project Ideas
18. Weather App
Show the current weather for a city using a free weather API.
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.
20. Student Marks Analyser
Read marks from Excel, find averages and toppers, and plot results.
21. Library Management System
Issue and return books with due dates and fines.
22. Snake Game
Classic snake game with score and increasing speed.
23. PDF Merger and Splitter
Merge several PDFs or extract pages from one.
24. Automatic File Organiser
Sort files in your Downloads folder into folders by type.
25. Personal Portfolio Website
A small website about you built with a Python web framework.
How to Run These Python Projects
- Install Python 3 from python.org (tick “Add Python to PATH” on Windows).
- Install a free editor such as VS Code and its Python extension.
- Create a file such as
game.py, paste or type the code and save it. - Run it from the terminal with
python game.py. - 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
- Python roadmap for beginners (8–12 weeks)
- DSA projects in Python
- Python projects for final year students
- Machine learning projects for final year
- Python MCQs and Python interview questions
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.