Mastering Python in 7 Days: A Complete Roadmap for Beginners
Maigie Team
Developer Education
Your first week with Python can set the direction for your entire programming career. This roadmap doesn't promise you'll become a senior developer in 168 hours, but it will give you a solid, structured foundation that most self-taught learners take months to build without a plan.
Whether you're switching careers, prepping for a CS course, or just curious about coding, this guide breaks Python down into seven focused days — each building on the last.
Why Python? (And Why 7 Days Works)
Python consistently tops language rankings for a reason:
- Readable syntax — closest to writing in plain English
- Massive ecosystem — web, data science, AI, automation, scripting
- Beginner-friendly — fewer boilerplate lines than Java, C++, or JavaScript
- In-demand — among the top 3 most requested skills in tech job postings
A 7-day sprint works because Python's basics are learnable in short, focused sessions. You're not memorizing, you're building muscle memory through daily practice.
Pro tip: Pair this roadmap with Maigie to auto-generate a structured Python course, track your progress, and use spaced repetition to retain what you learn.
Before You Start: Setup (30 Minutes)
Get these ready before Day 1:
| Tool | Purpose | Link |
|---|---|---|
| Python 3.12+ | The language itself | python.org/downloads |
| VS Code | Code editor | code.visualstudio.com |
| Python extension | Syntax highlighting, linting | Install from VS Code marketplace |
| Terminal | Running scripts | Built into VS Code or your OS |
Verify your install:
python --version
# Expected: Python 3.12.x or higher
Day 1: Variables, Data Types, and Basic I/O
Goal: Understand how Python stores and manipulates data.
What to Learn
- Variables and assignment (
x = 10) - Data types:
int,float,str,bool - Type conversion:
int(),str(),float() - Input/output:
input()andprint() - String formatting: f-strings (
f"Hello {name}") - Basic arithmetic operators
Practice Project
Build a unit converter — ask the user for a temperature in Celsius and convert it to Fahrenheit:
celsius = float(input("Enter temperature in Celsius: "))
fahrenheit = (celsius * 9/5) + 32
print(f"{celsius}°C = {fahrenheit}°F")
Key Takeaway
Everything in Python is an object. Even simple numbers have methods. Understanding types early prevents confusing bugs later.
Day 2: Control Flow — Conditionals and Loops
Goal: Make your programs make decisions and repeat actions.
What to Learn
if,elif,elsestatements- Comparison operators:
==,!=,>,<,>=,<= - Logical operators:
and,or,not forloops (includingrange())whileloopsbreak,continue, andpass
Practice Project
Build a number guessing game:
import random
secret = random.randint(1, 100)
attempts = 0
while True:
guess = int(input("Guess the number (1-100): "))
attempts += 1
if guess < secret:
print("Too low!")
elif guess > secret:
print("Too high!")
else:
print(f"Correct! You got it in {attempts} attempts.")
break
Key Takeaway
Loops and conditionals are the backbone of every program. Once these feel natural, you can solve most beginner-level problems.
Day 3: Data Structures — Lists, Tuples, Dictionaries, Sets
Goal: Learn how to organize and access collections of data.
What to Learn
| Structure | Mutable | Ordered | Use case |
|---|---|---|---|
| List | ✅ | ✅ | General-purpose sequences |
| Tuple | ❌ | ✅ | Fixed data, dictionary keys |
| Dictionary | ✅ | ✅ (3.7+) | Key-value lookups |
| Set | ✅ | ❌ | Unique items, membership tests |
- List methods:
append(),pop(),sort(), slicing - Dictionary methods:
get(),keys(),values(),items() - List comprehensions:
[x**2 for x in range(10)] - Nested data structures
Practice Project
Build a contact book — store names and phone numbers in a dictionary, with add, search, and delete functionality:
contacts = {}
while True:
action = input("Add / Search / Delete / Quit: ").lower()
if action == "add":
name = input("Name: ")
phone = input("Phone: ")
contacts[name] = phone
print(f"Added {name}.")
elif action == "search":
name = input("Name: ")
print(contacts.get(name, "Not found."))
elif action == "delete":
name = input("Name: ")
if contacts.pop(name, None):
print(f"Deleted {name}.")
else:
print("Not found.")
elif action == "quit":
break
Key Takeaway
Choosing the right data structure makes your code faster and cleaner. Lists for sequences, dictionaries for lookups, sets for uniqueness.
Day 4: Functions and Modules
Goal: Write reusable code and organize it into modules.
What to Learn
- Defining functions with
def - Parameters, default values, and return values
*argsand**kwargs- Scope: local vs global variables
- Importing modules:
import,from ... import - Creating your own modules (separate
.pyfiles) - The
if __name__ == "__main__"pattern
Practice Project
Build a password generator module:
# password_generator.py
import random
import string
def generate_password(length=12, use_special=True):
chars = string.ascii_letters + string.digits
if use_special:
chars += string.punctuation
return ''.join(random.choice(chars) for _ in range(length))
if __name__ == "__main__":
print(generate_password(16))
Then import it in another script:
from password_generator import generate_password
print(generate_password(20, use_special=False))
Key Takeaway
Functions are the building blocks of clean code. If you find yourself copying and pasting, it's time to write a function.
Day 5: File Handling and Error Management
Goal: Read from and write to files, and handle errors gracefully.
What to Learn
- Opening files:
open()with'r','w','a'modes - The
withstatement (context managers) - Reading:
read(),readline(),readlines() - Writing and appending to files
- Working with CSV files (
csvmodule) - Working with JSON (
jsonmodule) try,except,finally, andraise- Common exceptions:
ValueError,FileNotFoundError,KeyError
Practice Project
Build a personal expense tracker that saves to a JSON file:
import json
from datetime import date
FILENAME = "expenses.json"
def load_expenses():
try:
with open(FILENAME, "r") as f:
return json.load(f)
except FileNotFoundError:
return []
def save_expenses(expenses):
with open(FILENAME, "w") as f:
json.dump(expenses, f, indent=2)
def add_expense():
amount = float(input("Amount: "))
category = input("Category: ")
expenses = load_expenses()
expenses.append({
"amount": amount,
"category": category,
"date": str(date.today())
})
save_expenses(expenses)
print("Expense saved!")
add_expense()
Key Takeaway
Real programs interact with the outside world, files, APIs, databases. File I/O and error handling are non-negotiable skills.
Day 6: Object-Oriented Programming (OOP)
Goal: Understand classes, objects, inheritance, and encapsulation.
What to Learn
- Classes and objects
- The
__init__constructor - Instance methods and attributes
selfkeyword- Inheritance and
super() - Encapsulation (private attributes with
_convention) - Magic methods:
__str__,__repr__,__len__
Practice Project
Build a library management system:
class Book:
def __init__(self, title, author, isbn):
self.title = title
self.author = author
self.isbn = isbn
self.is_available = True
def __str__(self):
status = "Available" if self.is_available else "Checked out"
return f"{self.title} by {self.author} [{status}]"
class Library:
def __init__(self):
self.books = []
def add_book(self, book):
self.books.append(book)
def search(self, query):
return [b for b in self.books
if query.lower() in b.title.lower()
or query.lower() in b.author.lower()]
def checkout(self, isbn):
for book in self.books:
if book.isbn == isbn and book.is_available:
book.is_available = False
return f"Checked out: {book.title}"
return "Book not available."
# Usage
lib = Library()
lib.add_book(Book("Python Crash Course", "Eric Matthes", "978-1593279288"))
lib.add_book(Book("Automate the Boring Stuff", "Al Sweigart", "978-1593279929"))
print(lib.search("python"))
Key Takeaway
OOP helps you model real-world problems. You don't need it for every script, but understanding it unlocks frameworks like Django, Flask, and most production codebases.
Day 7: Libraries, APIs, and Your Capstone Project
Goal: Use external libraries and build something you can show off.
What to Learn
- Installing packages with
pip - Key libraries for beginners:
| Library | Purpose |
|---|---|
requests | HTTP requests and APIs |
beautifulsoup4 | Web scraping |
pandas | Data analysis |
matplotlib | Data visualization |
flask | Simple web apps |
- Making API calls with
requests - Parsing JSON responses
- Virtual environments (
python -m venv)
Capstone Project: Weather Dashboard CLI
Combine everything you've learned:
import requests
import json
API_KEY = "your_api_key" # Get free key from openweathermap.org
BASE_URL = "https://api.openweathermap.org/data/2.5/weather"
def get_weather(city):
params = {"q": city, "appid": API_KEY, "units": "metric"}
try:
response = requests.get(BASE_URL, params=params)
response.raise_for_status()
data = response.json()
return {
"city": data["name"],
"temp": data["main"]["temp"],
"description": data["weather"][0]["description"],
"humidity": data["main"]["humidity"],
}
except requests.exceptions.RequestException as e:
return {"error": str(e)}
def save_history(record):
history = []
try:
with open("weather_history.json", "r") as f:
history = json.load(f)
except FileNotFoundError:
pass
history.append(record)
with open("weather_history.json", "w") as f:
json.dump(history, f, indent=2)
city = input("Enter city: ")
weather = get_weather(city)
if "error" not in weather:
print(f"\n{weather['city']}: {weather['temp']}°C, {weather['description']}")
print(f"Humidity: {weather['humidity']}%")
save_history(weather)
else:
print(f"Error: {weather['error']}")
This project uses: variables, functions, dictionaries, file I/O, error handling, modules, and an external library — everything from the week.
Learning Tool Comparison: Which Resources to Use
Pairing this roadmap with the right tools makes a major difference. Here's how popular options compare for learning Python:
| Tool | Best for | Self-pacing | Practice | Progress tracking | Price |
|---|---|---|---|---|---|
| Maigie | Structured course + AI tutor + spaced repetition | ✅ | ✅ AI-generated | ✅ Built-in | Free + Premium |
| freeCodeCamp | Free video curriculum | ✅ | ⚠️ Limited | ❌ | Free |
| Codecademy | Interactive browser exercises | ✅ | ✅ | ✅ | Free + $40/mo |
| LeetCode | Algorithm practice (after basics) | ✅ | ✅ Strong | ✅ | Free + $13/mo |
| YouTube (Corey Schafer, Tech With Tim) | Video walkthroughs | ✅ | ❌ | ❌ | Free |
| Real Python | In-depth articles and tutorials | ✅ | ⚠️ | ❌ | Free + $20/mo |
| Python.org docs | Official reference | ✅ | ❌ | ❌ | Free |
When to Use What
- Days 1–3 (Basics): Maigie or Codecademy for structured practice. YouTube for visual learners.
- Days 4–5 (Functions, Files): Real Python or freeCodeCamp for deeper explanations.
- Days 6–7 (OOP, Projects): Build your own projects. Use Maigie's AI tutor to get unstuck and review concepts with spaced repetition.
- After the 7 days: LeetCode for algorithms, Real Python for advanced topics, Maigie for continued review and goal tracking.
Tips for Making the 7 Days Count
- Code every day — Even 45 minutes of focused practice beats 4 hours of passive watching.
- Type every example — Don't copy-paste. Typing builds muscle memory.
- Break things on purpose — Change values, remove lines, see what errors look like. Debugging is learning.
- Use spaced repetition — Review Day 1 concepts on Day 3, Day 2 on Day 5. Tools like Maigie automate this.
- Build, don't just read — Each day has a project for a reason. Modify them. Extend them. Make them yours.
- Ask AI when stuck — Use an AI tutor (Maigie, ChatGPT) to explain errors instead of staring at them for 30 minutes.
- Track your progress — Write down what you learned each day. Seeing progress keeps motivation high.
What Comes After Day 7?
Seven days gives you the foundation. Here's where to go next:
| Path | What to learn next |
|---|---|
| Web Development | Flask or Django, HTML/CSS, databases |
| Data Science | pandas, NumPy, matplotlib, Jupyter notebooks |
| Automation | Selenium, os and shutil modules, scheduling scripts |
| Machine Learning | scikit-learn, TensorFlow basics |
| DevOps / Scripting | Docker, APIs, cloud services (AWS, GCP) |
The key is to pick one direction and go deep, rather than jumping between paths.
Summary
Here's your 7-day roadmap at a glance:
| Day | Topic | Key Project |
|---|---|---|
| 1 | Variables, types, I/O | Unit converter |
| 2 | Conditionals, loops | Number guessing game |
| 3 | Lists, dicts, sets | Contact book |
| 4 | Functions, modules | Password generator |
| 5 | Files, error handling | Expense tracker |
| 6 | OOP | Library manager |
| 7 | Libraries, APIs, capstone | Weather dashboard |
Python is one of the few languages where a week of focused effort gives you real, usable skills. The roadmap above isn't theory — it's a practical path to writing code that actually does things.
Ready to start? Create a free Python course on Maigie and let AI structure your learning, track your progress, and keep you on schedule.


