Python Learning Curriculum
Stage 1: Python Basics
- Variables & data types
- Input/output
- Arithmetic operators
- If/elif/else statements
- Loops (for, while)
- Comments
Exercises:
1. Print "Hello, World!"
2. Ask the user for their name and age and print it.
3. Write a program that checks if a number is even or odd.
4. Create a simple calculator that adds, subtracts, multiplies, or divides two numbers.
5. Loop from 1 to 100 and print all multiples of 5.
Stage 2: Data Structures
- Strings, Lists, Tuples, Sets, Dictionaries
- Indexing, slicing
- List comprehensions
Exercises:
1. Reverse a string.
2. Count word frequency.
3. Sort a list manually.
4. Remove duplicates.
5. Character frequency in a string.
Stage 3: Functions and Modules
- Defining functions, *args, **kwargs
- Importing/writing modules
Exercises:
1. Factorial function.
2. Max of 3 numbers.
3. Simulate dice roll.
4. Create and import your own module.
5. Sum variable number of args.
Stage 4: File Handling & Exceptions
- Reading/writing files
- with statement
- try/except
Exercises:
1. Save user input to a file.
2. Read and print file contents.
3. Handle ZeroDivisionError.
4. Log errors to file.
5. Task list file manager.
Stage 5: Object-Oriented Programming
- Classes, objects, methods
- __init__, __str__
- Inheritance
Exercises:
1. Dog class with bark().
2. Update dog's age.
3. Student and School classes.
4. Override method.
5. Nicely print object info.
Stage 6: Intermediate Python
- List/dict comprehensions
- Generators, decorators
- map, filter, reduce
- Regex
Exercises:
1. Fibonacci generator.
2. Square list with map().
3. Decorator to log calls.
4. Email validation with regex.
5. Extract digits from string.
Stage 7: Libraries
- Data science: numpy, pandas, matplotlib
- Web: flask, django
- APIs: requests, json
- Automation: selenium, pyautogui
Sample Exercises:
1. Analyze CSV with pandas.
2. Build web form with Flask.
3. Fetch API data.
4. Automate search.
Stage 8: Final Projects
1. To-do list with file I/O.
2. Web scraper.
3. Flask blog/portfolio.
4. Expense tracker.
5. Chatbot or quiz.
Stage 9: Testing & Best Practices
- unittest, pytest
- Docstrings, type hints
- Formatters: black, flake8
Exercises:
1. Unit test calculator.
2. Add type hints.
3. Format with black.
Resources:
- https://docs.python.org/3/
- https://www.w3schools.com/python/
- https://realpython.com/
- https://www.w3resource.com/python-exercises/