I've taught Python to over 500 absolute beginners—people who'd never written a line of code in their lives. Some were accountants, some were designers, one was a retired chef who wanted to build a recipe database. Every single one of them was capable of writing meaningful Python programs within one week. Not "hello world." Real programs that did useful things.
The secret is structure. Most coding courses throw too much at you too fast. This guide is different. Each day has exactly one new concept, one exercise, and one mini-project. Do the work. Skip nothing. At the end of day 7, you'll have built something you can actually use.
🗓 Day 1: Setup and the REPL
Goal: Get Python running and write your first real code.
Go to python.org and download Python 3.12+. During installation on Windows, check "Add Python to PATH." On Mac, it's already installed but get the latest from the website anyway.
Open your terminal (Command Prompt on Windows, Terminal on Mac). Type python and press Enter. You're now in the Python REPL—a live coding environment. Try this:
>>> print("Hello, I'm learning Python!")
>>> 42 * 3
>>> "Python" + " " + "is" + " " + "fun"
>>> len("supercalifragilisticexpialidocious")
The REPL is your best friend. Any time you're unsure how something works, test it here. No saving, no file management—just type and see results instantly.
Mini-Project: Use the REPL to calculate how many days you've been alive. Multiply your age by 365. Add leap years. Print the result.
🗓 Day 2: Variables and Data Types
Goal: Store and manipulate data.
Variables are labeled boxes that hold data. Python has four basic data types you need to know:
- Strings (
"hello") — text - Integers (
42) — whole numbers - Floats (
3.14) — decimal numbers - Booleans (
True/False) — yes/no values
name = "Alice"
age = 28
height = 1.68
is_student = True
print(f"{name} is {age} years old and {height}m tall.")
# Output: Alice is 28 years old and 1.68m tall.
Notice the f before the string? That's an f-string—the cleanest way to insert variables into text. Use them. Love them.
Mini-Project: Create variables for a fictional character (name, age, profession, catchphrase). Print a bio using f-strings. Then update the age by 10 years and print the "10 years later" version.
🗓 Day 3: Lists, Dictionaries, and Loops
Goal: Work with collections of data.
Lists store ordered items. Dictionaries store key-value pairs. Loops let you process them efficiently.
# Lists
hobbies = ["reading", "coding", "hiking"]
hobbies.append("cooking")
print(hobbies[0]) # reading
print(len(hobbies)) # 4
# Dictionaries
person = {
"name": "Bob",
"skills": ["Python", "Excel", "SQL"],
"years_experience": 3
}
print(person["name"]) # Bob
# For loop
for hobby in hobbies:
print(f"I enjoy {hobby}")
The for loop is the workhorse of Python. Get comfortable with it. You'll use it in almost every program you write.
Mini-Project: Create a dictionary of 5 movies (title as key, rating as value). Write a loop that prints "Movie: [title] — Rating: [rating]" for each. Then add a new movie and find the highest-rated one using a loop.
🗓 Day 4: Functions and Conditionals
Goal: Write reusable code that makes decisions.
Functions package code into reusable blocks. Conditionals let your code make decisions.
def calculate_bmi(weight_kg, height_m):
bmi = weight_kg / (height_m ** 2)
if bmi < 18.5:
category = "underweight"
elif bmi < 25:
category = "healthy"
elif bmi < 30:
category = "overweight"
else:
category = "obese"
return round(bmi, 1), category
result, category = calculate_bmi(70, 1.75)
print(f"BMI: {result} — {category}")
Notice the def keyword, the return statement, and the if/elif/else chain. This pattern—define a function that takes inputs, processes them, and returns outputs—is the foundation of all Python programming.
Mini-Project: Write a function called grade_calculator(score) that takes a number 0-100 and returns a letter grade (A, B, C, D, F) with + and - modifiers. Then test it with 10 different scores in a loop.
🗓 Day 5: Reading and Writing Files
Goal: Work with real data from files.
Computers are useless without data. File I/O is how you get data in and out of your programs.
# Writing to a file
with open("notes.txt", "w") as file:
file.write("Day 1: Learned variables\n")
file.write("Day 2: Learned lists\n")
# Reading from a file
with open("notes.txt", "r") as file:
content = file.read()
print(content)
# Reading line by line
with open("notes.txt", "r") as file:
for line in file:
print(f"Read: {line.strip()}")
The with statement is important—it automatically closes the file when you're done. Always use it.
Mini-Project: Create a simple to-do list app. Store tasks in a text file (one per line). Write functions to: add a task, view all tasks, and mark a task as done (prepend it with "[DONE]").
🗓 Day 6: Introduction to Libraries
Goal: Use other people's code to do amazing things.
Python's superpower is its ecosystem of libraries. Installing a library is a pip install command away. Here are three every beginner should know:
# 1. Random — generate random data
import random
dice = random.randint(1, 6)
print(f"You rolled a {dice}")
# 2. Datetime — work with dates
from datetime import datetime
today = datetime.now()
print(f"Today is {today.strftime('%A, %B %d, %Y')}")
# 3. CSV — handle spreadsheets
import csv
with open("data.csv", "r") as f:
reader = csv.DictReader(f)
for row in reader:
print(row["Name"], row["Score"])
Don't try to memorize library functions. Learn to read documentation. When you need to do something, search "[task] python library" and skim the documentation for examples.
Mini-Project: Use the random library to build a number guessing game. The computer picks a number between 1-100, and the player gets 7 guesses. Give hints ("too high" / "too low") after each guess.
🗓 Day 7: Your First Real Project
Goal: Build a complete, useful application.
Today you combine everything you've learned. Here's the project: build a personal expense tracker that runs in the terminal.
import json
import os
from datetime import datetime
EXPENSE_FILE = "expenses.json"
def load_expenses():
if os.path.exists(EXPENSE_FILE):
with open(EXPENSE_FILE, "r") as f:
return json.load(f)
return []
def add_expense(amount, category, description):
expenses = load_expenses()
expense = {
"amount": amount,
"category": category,
"description": description,
"date": datetime.now().strftime("%Y-%m-%d")
}
expenses.append(expense)
with open(EXPENSE_FILE, "w") as f:
json.dump(expenses, f, indent=2)
print(f"✅ Added: ${amount} for {description}")
def show_summary():
expenses = load_expenses()
total = sum(e["amount"] for e in expenses)
by_category = {}
for e in expenses:
by_category[e["category"]] = by_category.get(e["category"], 0) + e["amount"]
print(f"\n💰 Total Spent: ${total:.2f}")
print("📊 By Category:")
for cat, amt in sorted(by_category.items(), key=lambda x: x[1], reverse=True):
print(f" {cat}: ${amt:.2f}")
print(f"📝 Total Entries: {len(expenses)}")
# Main program loop
print("=== Expense Tracker ===")
while True:
print("\n1. Add expense")
print("2. View summary")
print("3. Quit")
choice = input("Choose: ")
if choice == "1":
amount = float(input("Amount: $"))
category = input("Category (Food/Transport/Entertainment/etc): ")
desc = input("Description: ")
add_expense(amount, category, desc)
elif choice == "2":
show_summary()
elif choice == "3":
print("Goodbye!")
break
This project uses variables, lists, dictionaries, functions, conditionals, loops, file I/O, a third-party library (json), and user input. It's a complete application that you can actually use to track your spending.
Your challenge: Modify it to add a delete expense feature and a "spending limit" alert if you exceed a budget.
What's Next?
You've built the foundation. Here's how to keep going:
- Days 8-14: Build two more projects. A password generator and a weather app using a free API.
- Days 15-21: Learn object-oriented programming (OOP) with classes. Refactor your expense tracker using classes.
- Days 22-30: Pick a specialization: web development (Flask/Django), data analysis (Pandas), or automation (Selenium/BeautifulSoup).
The hardest part is the first week. You've done it. Now go build something that matters to you. That's how real learning happens.