A structured roadmap to learn Python from scratch in 30 days.
- Install Python and set up your development environment (VS Code/PyCharm)
- Learn about variables, data types (int, float, string, boolean)
- Practice: Write a program that calculates your age in days
- Arithmetic, comparison, and logical operators
- Taking user input with
input() - Practice: Build a simple calculator
- String methods and operations
- String formatting (f-strings, format())
- Practice: Create a text manipulation tool
- Creating and manipulating lists
- List methods (append, remove, sort, etc.)
- Understanding tuples and their immutability
- Practice: Build a to-do list program
- Working with key-value pairs
- Dictionary methods
- Set operations and use cases
- Practice: Create a phone book application
- if, elif, else statements
- Nested conditions
- Ternary operators
- Practice: Build a grade calculator
- Review Week 1 concepts
- Project: Number guessing game with multiple features
- for loops and range()
- Iterating through lists and dictionaries
- Practice: Print patterns using nested loops
- while loops
- break, continue, and pass statements
- Loop control techniques
- Practice: Build a menu-driven program
- Defining and calling functions
- Parameters and arguments
- Return statements
- Practice: Create utility functions (e.g., temperature converter)
- Default parameters and keyword arguments
- *args and **kwargs
- Lambda functions
- Practice: Build a collection of mathematical functions
- Local vs global variables
- Understanding recursion
- Practice: Implement factorial and Fibonacci using recursion
- try, except, finally blocks
- Handling specific exceptions
- Raising custom exceptions
- Practice: Add error handling to previous projects
- Review Week 2 concepts
- Project: Simple banking system with functions and error handling
- Basic list comprehensions
- Conditional list comprehensions
- Dictionary and set comprehensions
- Practice: Refactor loops into comprehensions
- Importing built-in modules (math, random, datetime)
- Creating your own modules
- Understanding name == "main"
- Practice: Organize previous code into modules
- Classes and objects
- Attributes and methods
- The init constructor
- Practice: Create a Student class with properties
- Inheritance and polymorphism
- Encapsulation and private attributes
- Class methods and static methods
- Practice: Build a simple game with multiple classes
- Installing packages with pip
- Introduction to requests (API calls)
- Introduction to pandas (data manipulation)
- Practice: Fetch data from a public API
- Reading and writing text files
- Working with CSV files
- File modes and context managers
- Practice: Create a note-taking app that saves to files
- Review Week 3 concepts
- Project: Contact management system with file persistence and OOP
- Pattern matching basics
- Common regex patterns
- re module functions
- Practice: Build an email/phone validator
- Understanding decorators
- Creating generator functions
- yield vs return
- Practice: Create timing decorators for functions
- Stacks and queues
- Working with collections module
- Understanding time complexity basics
- Practice: Implement a stack-based calculator
- Reading and writing JSON files
- Converting between Python objects and JSON
- Working with APIs
- Practice: Build a weather app using a weather API
- Writing unit tests with unittest
- Test-driven development basics
- Debugging techniques
- Practice: Write tests for previous projects
- Creating virtual environments
- requirements.txt
- PEP 8 style guide
- Code documentation
- Practice: Organize a project with proper structure
Choose one project to build:
- Web Scraper: Scrape data from websites using BeautifulSoup
- CLI Application: Build a command-line task manager or expense tracker
- Data Analysis: Analyze a dataset using pandas and create visualizations
- Automation Script: Automate a repetitive task (file organization, email sending)
- Simple Web App: Create a basic Flask/FastAPI application
- Python.org official documentation
- Real Python tutorials
- W3Schools Python
- freeCodeCamp Python course
- LeetCode (Easy problems)
- HackerRank Python track
- Codewars
- Exercism
- "Python Crash Course" by Eric Matthes
- "Automate the Boring Stuff with Python" by Al Sweigart
- Code every day: Consistency is more important than duration
- Type code yourself: Don't just copy-paste, type it out
- Build projects: Apply what you learn immediately
- Debug actively: Don't fear errors, learn from them
- Join communities: Reddit (r/learnpython), Discord servers, Stack Overflow
- Review regularly: Spend 10 minutes reviewing previous concepts
- Take breaks: Your brain needs rest to consolidate learning
- Week 1: Fundamentals
- Week 2: Control Flow & Functions
- Week 3: Intermediate Concepts
- Week 4: Advanced Topics & Final Project
Remember: Everyone learns at their own pace. If you need more time on certain topics, that's perfectly fine. The goal is understanding, not speed.
Good luck on your Python journey! 🐍