IT Training
Blog
Search

12 Python Projects for Beginners (With Source Code)

Laptop showing Python code on a clean desk

The fastest way to get better at Python is to build small projects that use what you just learned, then extend them one feature at a time. Below are 12 Python projects for beginners, ordered from easiest to hardest, with source code for the first few so you can get started straight away. Each project lists the concepts it practises and ideas to make it your own.

Before you start

  • Install Python 3 and a code editor such as VS Code.
  • Create a separate folder and virtual environment for each project: python -m venv venv.
  • Push every project to GitHub with a short README. Small, finished projects are worth more than big, abandoned ones.

If you are completely new, follow our 60-day plan to learn Python first, then come back here.

Level 1: Your first programs

1. Number guessing game

Practises: variables, loops, conditions, the random module.

import random

secret = random.randint(1, 100)
tries = 0

while True:
    guess = int(input('Guess a number from 1 to 100: '))
    tries += 1
    if guess < secret:
        print('Too low')
    elif guess > secret:
        print('Too high')
    else:
        print(f'Correct! You took {tries} tries.')
        break

Extend it: handle non-number input with try/except, add difficulty levels, and save the best score to a file.

2. Simple calculator

Practises: functions, dictionaries, input validation.

def add(a, b): return a + b
def sub(a, b): return a - b
def mul(a, b): return a * b
def div(a, b):
    if b == 0:
        return 'Cannot divide by zero'
    return a / b

ops = {'+': add, '-': sub, '*': mul, '/': div}

a = float(input('First number: '))
op = input('Operator (+ - * /): ')
b = float(input('Second number: '))
print(ops[op](a, b) if op in ops else 'Unknown operator')

Extend it: keep a history of calculations, or build a GUI version with tkinter.

3. Password generator

Practises: strings, the secrets module, command-line arguments.

import secrets
import string

def make_password(length=14):
    chars = string.ascii_letters + string.digits + '!@#$%^&*'
    return ''.join(secrets.choice(chars) for _ in range(length))

print(make_password())

Use secrets, not random, for anything security-related, because it is designed to be unpredictable.

Extend it: guarantee at least one digit and one symbol, and accept the length with argparse.

4. To-do list in the terminal

Practises: lists, file handling, JSON.

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()
    if cmd == 'add':
        tasks.append({'title': input('Task: '), 'done': False})
    elif cmd == 'list':
        for i, t in enumerate(tasks, 1):
            mark = 'x' if t['done'] else ' '
            print(f'{i}. [{mark}] {t["title"]}')
    elif cmd == 'done':
        tasks[int(input('Number: ')) - 1]['done'] = True
    elif cmd == 'quit':
        break
    with open(FILE, 'w') as f:
        json.dump(tasks, f, indent=2)

Extend it: add due dates and priorities, then move the storage to SQLite.

Level 2: Working with files, APIs and data

5. Expense tracker with a monthly report

Store expenses in a CSV file with date, category and amount. Print the total per category for any month, and the biggest expense.

Practises: the csv module, dates with datetime, grouping with dictionaries. Extend it: use pandas and plot a pie chart with matplotlib.

6. File organiser

Scan your Downloads folder and move files into subfolders by type: images, PDFs, videos, archives and so on.

Practises: pathlib, shutil, working safely with the file system. Add a dry run mode that only prints what it would move; that habit will save you one day.

7. Weather app using a public API

Ask for a city, call a free weather API with requests, and print the temperature and conditions.

Practises: HTTP requests, JSON responses, error handling, keeping API keys in environment variables instead of in your code.

8. Quiz app

Load questions from a JSON file, shuffle them, ask each one, and show the score at the end.

Practises: data structures, functions, separating data from logic. Extend it: add a timer and categories.

Level 3: Projects that look good on a resume

9. Web scraper with a CSV export

Collect public data, such as book titles and prices from a practice scraping site, using requests and BeautifulSoup, and save it to CSV.

Practises: HTML parsing, pagination, polite scraping. Always check a website’s terms and robots.txt before scraping it, and add delays between requests.

10. Automated email or report sender

Read data from an Excel or CSV file, create a summary, and email it on a schedule.

Practises: openpyxl or pandas, the smtplib module, scheduling with cron or Task Scheduler. Automation projects like this are exactly what many companies hire Python developers for.

11. URL shortener web app with Flask

Create a page where users paste a long URL and get a short code. Store the mappings in SQLite and redirect visitors.

Practises: routes, forms, templates, a database, and deploying a small web app.

12. Personal finance or habit dashboard with Streamlit

Turn your expense tracker or habit data into an interactive dashboard with filters and charts.

Practises: pandas, charts, building a UI in pure Python, and deployment to a free hosting platform.

How to choose your next project

Career goalProjects to prioritise
Data analyst or data scientistExpense tracker, web scraper, Streamlit dashboard
Backend or full stack developerTo-do list with SQLite, URL shortener, weather app
Automation, testing or DevOpsFile organiser, report sender, scraper

Tips to finish what you start

  • Write the smallest working version first, then add one feature at a time.
  • Read error messages carefully. The last line usually tells you exactly what went wrong.
  • Commit to Git after every working step, so you can always go back.
  • Write a README with a screenshot and instructions to run the project.

When you can build several of these without following a tutorial line by line, test yourself with our Python interview questions.

Frequently asked questions

Which Python project is best for absolute beginners?

The number guessing game or a simple calculator. Both use only variables, loops, conditions and input, and you can finish them in an evening.

How many Python projects should I have on my resume?

Three to five finished projects with clear READMEs are enough for most fresher roles. Choose projects that match the job you are applying for.

Is it okay to follow tutorials for projects?

Yes, at first. Then rebuild the project from memory and add a feature the tutorial did not cover. That second step is where real learning happens.

Do I need to know libraries like pandas before building projects?

No. Start with plain Python. Learn a library when a project needs it; you will remember it much better that way.

Explore more Python tutorials on Radium4.

Other articles

Radium4 — IT training blog

Practical, plain-English guides for DevOps, cloud, data, Python, testing and security learners.