Python Fundamentals Taught in Days 1‑20 of the Python‑100‑Days Course

TLDR: Days 1‑20 of the jackfrued/Python‑100‑Days repository provide a comprehensive introduction to Python, covering language basics, control structures, four essential data structures, functional programming patterns, and object‑oriented design principles.

The Day01‑20 folder in the jackfrued/Python‑100‑Days repository contains the foundational curriculum for absolute beginners. These Python fundamentals progress from writing your first script to building object‑oriented applications, with each day's content documented in dedicated markdown files. Mastering these twenty days establishes the core competency required for data analysis, web development, and automation scripting.

Days 1‑9: Language Basics and Control Flow

While the repository emphasizes Days 10‑20 for core data structures and programming paradigms, Days 1‑9 establish essential prerequisites. According to the file structure, Day01-20/01.初识Python.md covers Python installation and language philosophy, while Day01-20/02.第一个Python程序.md introduces variables, input/output operations, and basic operators. Subsequent days through Day 9 typically cover conditional statements, loop constructs, and the list data structure, preparing students for the immutable collections introduced in Day 10.

Days 10‑13: Core Data Structures (Tuples, Strings, Sets, Dictionaries)

Days 10 through 13 dive deep into Python's built‑in collection types, providing the tools for efficient data manipulation and storage.

Day 10: Tuples (元组)

Documented in Day01-20/10.常用数据结构之元组.md, Day 10 introduces immutable ordered collections. Tuples support indexing and slicing like lists, but their immutability makes them suitable for fixed data records and safe dictionary keys. The curriculum emphasizes tuple unpacking for elegant variable assignment.


# Day 10 – Tuple unpacking

a, b, c = (1, 2, 3)
print(a, b, c)          # 1 2 3

Day 11: Strings (字符串)

The Day01-20/11.常用数据结构之字符串.md file covers string creation, formatting, and manipulation. The curriculum emphasizes modern f‑string syntax alongside legacy % formatting and str.format() methods, plus encoding considerations for international text processing.


# Day 11 – f‑string formatting

name = "Alice"
age = 30
print(f"{name} is {age} years old.")   # Alice is 30 years old.

Day 12: Sets (集合)

Day 12 (Day01-20/12.常用数据结构之集合.md) explores unordered collections of unique elements. The material focuses on mathematical set operations—union, intersection, and difference—for efficient membership testing and deduplication tasks.


# Day 12 – Set operations

evens = {2, 4, 6}
primes = {2, 3, 5, 7}
print(evens & primes)   # {2}

print(evens | primes)   # {2, 3, 4, 5, 6, 7}

Day 13: Dictionaries (字典)

The Day01-20/13.常用数据结构之字典.md lesson teaches key‑value mapping for fast data retrieval. Topics include dictionary comprehensions, iteration methods over keys and values, and the hash table implementation underlying Python's dict type.


# Day 13 – Dictionary comprehension

squares = {i: i*i for i in range(5)}
print(squares)          # {0: 0, 1: 1, 2: 4, 3: 9, 4: 16}

Days 14‑17: Functions and Modular Programming

This section transitions from data manipulation to code organization, reusability, and functional programming patterns.

Day 14: Functions and Modules (函数和模块)

As detailed in Day01-20/14.函数和模块.md, Day 14 covers function definition, argument passing, return values, and module imports. The curriculum explains the if __name__ == "__main__": idiom for script execution control and namespace management.


# Day 14 – Simple module usage

# utils.py

def greet(name):
    return f"Hello, {name}!"

# main.py

from utils import greet
print(greet("Bob"))      # Hello, Bob!

Day 15: Practical Function Applications (函数应用实战)

Documented in Day01-20/15.函数应用实战.md, this day applies previously learned concepts to real‑world projects combining file I/O, string processing, and function composition without introducing new syntax.

Day 16: Advanced Function Usage (函数使用进阶)

The Day01-20/16.函数使用进阶.md file introduces higher‑order functions, variable arguments, and decorators. Students learn to use *args and **kwargs for flexible function signatures and lambda expressions for anonymous functional programming.


# Day 16 – *args and **kwargs

def printer(*args, **kwargs):
    for a in args:
        print(a)
    for k, v in kwargs.items():
        print(f"{k}={v}")

printer(1, 2, a=10, b=20)

Day 17: Advanced Function Techniques (函数高级应用)

Day 17 (Day01-20/17.函数高级应用.md) covers closures, partial functions, memoization, and generators. The yield keyword is introduced for memory‑efficient iteration, allowing functions to maintain state between calls without storing entire sequences in memory.


# Day 17 – Generator with yield

def countdown(n):
    while n > 0:
        yield n
        n -= 1

for x in countdown(5):
    print(x)            # 5 4 3 2 1

Days 18‑20: Object‑Oriented Programming

The final three days transition to OOP, enabling students to model complex systems using classes, inheritance, and encapsulation.

Day 18: OOP Basics (面向对象编程入门)

The Day01-20/18.面向对象编程入门.md lesson introduces classes, objects, constructors (__init__), and attribute access. Basic inheritance demonstrates code reuse through class hierarchies and method overriding.


# Day 18 – Basic class

class Person:
    def __init__(self, name):
        self.name = name
    def say(self):
        print(f"My name is {self.name}")

p = Person("Carol")
p.say()                 # My name is Carol

Day 19: Advanced OOP (面向对象编程进阶)

Documented in Day01-20/19.面向对象编程进阶.md, this day covers magic methods (__str__, __repr__, __len__), property decorators, and multiple inheritance. These tools enable Pythonic class interfaces that integrate seamlessly with built‑in functions and syntax.


# Day 19 – Property decorator

class Circle:
    def __init__(self, radius):
        self._r = radius
    @property
    def area(self):
        import math
        return math.pi * self._r ** 2

c = Circle(3)
print(c.area)           # 28.274333882308138

Day 20: OOP Applications (面向对象编程应用)

The Day01-20/20.面向对象编程应用.md capstone requires building a complete project such as a bank account system, integrating encapsulation, validation logic, and method design into a cohesive application.


# Day 20 – Simple OOP project (Bank account)

class Account:
    def __init__(self, owner, balance=0):
        self.owner = owner
        self.balance = balance
    def deposit(self, amount):
        self.balance += amount
    def withdraw(self, amount):
        if amount > self.balance:
            raise ValueError("Insufficient funds")
        self.balance -= amount

acc = Account("Dave", 100)
acc.deposit(50)
acc.withdraw(30)
print(acc.balance)      # 120

Summary

  • Days 1‑9 establish Python syntax, operators, conditionals, loops, and introductory lists.
  • Days 10‑13 master immutable tuples, string formatting, mathematical sets, and dictionary mappings.
  • Days 14‑17 progress from basic functions to advanced functional programming with decorators and generators.
  • Days 18‑20 deliver complete object‑oriented programming skills from class design to practical application development.
  • All materials reside in the Day01‑20 folder with specific files like 10.常用数据结构之元组.md and 18.面向对象编程入门.md providing detailed explanations and exercises.

Frequently Asked Questions

Do I need to complete Days 1‑9 before starting Day 10?

According to the repository structure in Day01-20, Days 1‑9 cover prerequisite syntax and control flow that Day 10 builds upon. Day 10 (10.常用数据结构之元组.md) assumes familiarity with variables and basic I/O covered in 01.初识Python.md and 02.第一个Python程序.md.

Which data structures are covered before functions in the curriculum?

Days 10‑13 cover tuples, strings, sets, and dictionaries (documented in files like 13.常用数据结构之字典.md) before Day 14 (14.函数和模块.md) introduces function definitions and modular programming.

What is the difference between Day 16 and Day 17 function content?

Day 16 (16.函数使用进阶.md) focuses on higher‑order functions, *args/**kwargs, and lambda expressions, while Day 17 (17.函数高级应用.md) advances to closures, partial functions, and memory‑efficient generators using yield.

How does Day 20 differ from Days 18 and 19 in OOP instruction?

While Day 18 (18.面向对象编程入门.md) covers class basics and Day 19 (19.面向对象编程进阶.md) explores magic methods and properties, Day 20 (20.面向对象编程应用.md) requires synthesizing these skills into a complete project such as the bank account system shown in the curriculum examples.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →