Skip to content

unrealandychan/learn-python-with-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Tutorial by AI

中文版

Banner

Welcome to this interactive Python tutorial! This course is designed to take you from a complete beginner to a proficient Python developer, equipped with modern tools and best practices.

How It Works

The tutorial is divided into 52 lessons, each covering a specific topic. Each lesson has its own directory containing two files:

  • instructions.md: A Markdown file with the lesson's content, explanations, and examples.
  • exercise.py (or main.py for FastAPI): A Python file with practice exercises for you to complete.

Getting Started

  1. Navigate to a lesson directory: Start with lesson_01.

  2. Read the instructions: Open the instructions.md file to learn about the topic.

  3. Complete the exercise: Open the exercise file and write the code to complete the exercises.

  4. Run your code: To run your exercise file and see the output, use the following command in your terminal, replacing lesson_01/exercise.py with the correct file path:

    python lesson_01/exercise.py

Beginner Lessons

  • Lesson 01: Intro to Python — Install Python, set up your environment, and write your first "Hello, World!" program.
  • Lesson 02: Variables & Data Types — Learn about integers, floats, strings, and booleans.
  • Lesson 03: Basic Operators — Arithmetic, comparison, and logical operators.
  • Lesson 04: User Input & Type Casting — Read input from users and convert between data types.
  • Lesson 05: Conditional Statements — Control flow with if, elif, and else.
  • Lesson 06: Lists — Create lists, access elements by index, and use slicing.
  • Lesson 07: List Methods — Mutate and manipulate lists with built-in methods.
  • Lesson 08: For Loops — Iterate over lists and ranges with for loops.
  • Lesson 09: While Loops — Repeat code while a condition is true.
  • Lesson 10: Dictionaries — Store and retrieve key-value pairs.
  • Lesson 11: Tuples & Sets — Immutable sequences and unordered unique collections.
  • Lesson 12: Defining & Calling Functions — Reuse code by writing your own functions.
  • Lesson 13: Function Arguments & Return Values — Positional, keyword, and default arguments; returning data.
  • Lesson 14: Variable Scope — Understand local vs. global scope and the global keyword.
  • Lesson 15: Modules & Importing — Use the standard library and import your own modules.
  • Lesson 16: File I/O Reading — Open and read text files with Python.
  • Lesson 17: File I/O Writing — Write and append data to files.
  • Lesson 18: Error Handling — Catch and handle exceptions with try, except, and finally.
  • Lesson 19: OOP Intro — Introduction to classes, objects, attributes, and methods.
  • Lesson 20: Next Steps — Review your progress and explore project ideas to keep learning.

Advanced Lessons

  • Lesson 21: OOP Inheritance — Extend classes and reuse code through inheritance.
  • Lesson 22: OOP Polymorphism — Override methods and use polymorphism for flexible code.
  • Lesson 23: OOP Encapsulation — Control access with public, protected, and private attributes.
  • Lesson 24: OOP Dunder Methods — Customise objects with magic methods like __str__ and __len__.
  • Lesson 25: Static and Class Methods — Use @staticmethod and @classmethod decorators.
  • Lesson 26: List Comprehensions — Write concise list transformations in a single expression.
  • Lesson 27: Dict and Set Comprehensions — Apply the comprehension pattern to dictionaries and sets.
  • Lesson 28: Lambda Functions — Create small anonymous functions with lambda.
  • Lesson 29: Map Filter Reduce — Functional-style data processing with map(), filter(), and reduce().
  • Lesson 30: Generators — Produce values lazily with generator functions and the yield keyword.
  • Lesson 31: Decorators — Wrap and enhance functions using decorators.
  • Lesson 32: Collections Module — Powerful container types: Counter, defaultdict, deque, and more.
  • Lesson 33: Dates and Times — Parse, format, and calculate dates and times with the datetime module.
  • Lesson 34: JSON Data — Serialize and deserialize JSON data with the json module.
  • Lesson 35: OS and Sys Modules — Navigate the filesystem and interact with the OS using os and sys.
  • Lesson 36: Multithreading — Run tasks concurrently with the threading module.
  • Lesson 37: Multiprocessing — Achieve true parallelism with the multiprocessing module.
  • Lesson 38: Asyncio Intro — Understand the event loop and the basics of asyncio.
  • Lesson 39: Async Await — Write clean asynchronous I/O code with async and await.
  • Lesson 40: Advanced Project — Build a capstone project that combines everything you've learned.

Essential Python Packages

  • Lesson 41: Requests Modulerequests - Make HTTP requests to APIs and websites.
  • Lesson 42: BeautifulSoup4BeautifulSoup4 - Parse HTML and scrape web pages.
  • Lesson 43: Pandaspandas - Powerful data analysis and manipulation.
  • Lesson 44: Matplotlibmatplotlib - Create charts and data visualisations.
  • Lesson 45: Seabornseaborn - High-level statistical data visualisation.
  • Lesson 46: FastAPIFastAPI - Build high-performance web APIs with automatic docs.

Professional Development Practices

  • Lesson 47: Git and GitHub — Track changes and collaborate using Git & GitHub.
  • Lesson 48: Pytest — Write and run automated tests with pytest.
  • Lesson 49: Ruff — Keep code clean with fast formatting and linting via ruff.
  • Lesson 50: UV Dependency Management — Manage virtual environments and dependencies with uv.
  • Lesson 51: Databases — Store and query data with SQLAlchemy and SQLite.
  • Lesson 52: Config Management — Manage secrets and settings safely using .env files.

Happy learning!

About

This is a repository for self learn Python, ALL the content are generated by AI!.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors