-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.qmd
More file actions
146 lines (93 loc) · 7.74 KB
/
index.qmd
File metadata and controls
146 lines (93 loc) · 7.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Preface {.unnumbered}
## Why This Book Exists
You have been using AI to write code. Maybe it started with a simple request, "build me a web scraper" or "make a script that renames these files", and it worked. Then you got more ambitious. The code got longer. And at some point, you hit the wall.
The wall is that moment when AI gives you code and you cannot tell whether it is correct. You paste an error back in and get a different error. You ask for a fix and the whole approach changes. You cannot tell which variables matter, what the logic is doing, or why it broke.
This book exists because of the wall.
But the wall is not the only reason to learn Python. AI keeps getting smarter, and the wall keeps moving further out. What does not move is curiosity. The desire to understand what is happening under the hood, not because you have to, but because you want to. Because knowing how code works makes you better at directing AI, better at evaluating its output, and better at building things that actually do what you need.
Whether you hit the wall and need to get past it, or you are simply curious about how the code works, this book gives you that understanding.
## How This Book Works
This is not a traditional Python textbook. You will not read pages of explanations and then try exercises at the end. Instead, you will learn through conversation with AI.
Every chapter follows the same pattern:
**The Wall**. A specific vibe-coding failure you will recognise. AI produced code that broke or confused you, and you could not diagnose why. This is the concept you are about to learn.
**Thinking Session**. You open a conversation with your AI assistant and explore the concept. Guided prompts help you ask the right questions, push back on oversimplified answers, and build genuine understanding. No code writing yet. Just thinking.
**The Gap**. A brief pause where the author connects what you learned to what you are about to build.
**Building Session**. You open a fresh AI conversation with clear context and direct AI to build something specific. The chatbot project evolves with each chapter, and you understand every line of what AI produces because you explored the concept first.
**Quick Reference**. A minimal syntax card for future reference.
The two-chat structure used in every chapter comes from the *Conversation, Not Delegation* framework and is detailed in *Converse Python, Partner AI*. You do not need to read either to use this book. The method is built into every chapter. The key insight: understanding compounds. Each concept makes the next one easier. Vibe coding does not compound. Each session starts from zero.
## Who This Book Is For
- People who have used AI to write code and want to understand what it produces
- Professionals who need enough Python to evaluate, modify, and direct AI-generated code
- Anyone curious about how programming works under the hood
- Readers of *Think Python, Direct AI* ready for deeper language knowledge
If you worked through *Think Python, Direct AI*, you already used variables, functions, lists, and dictionaries to build projects. This book makes that knowledge systematic. You understand how Python works, not just how to use it.
If you are starting fresh, the book stands on its own. Each chapter's Thinking Session builds understanding from the ground up through AI conversation.
## What This Book Is Not
This is not a computer science textbook. It does not cover algorithms, data structures theory, or computational thinking. That is what *Think Python, Direct AI* covers.
It is not a professional practices book. Project structure, testing frameworks, deployment, and CI/CD are covered in *Ship Python, Orchestrate AI*.
It is not a reference manual. It covers the fundamentals you need to read and direct AI-generated code. When you need more, your AI assistant and the official documentation will fill the gaps, and you will be equipped to evaluate what they give you.
## The Chatbot Project
Across every chapter, you build a chatbot that grows from a 10-line echo script to a full-featured conversational program. By the end:
- It remembers your name and tracks conversations
- It matches keywords and categorises messages
- It picks responses from configurable dictionaries
- It saves conversation history to files
- It handles errors gracefully
- It has a test suite
- It is structured as a proper Python package with classes
You build this through AI conversation, not by copying code from a textbook. Each Building Session adds one feature, and you understand every line because you explored the underlying concept in the Thinking Session first.
## Conventions Used in This Book
AI prompts appear in callout boxes:
::: {.callout-note title="Thinking Session Prompt"}
What is the difference between a list and a dictionary in Python? When should I use each one?
:::
Code examples appear with syntax highlighting:
```python
name = input("What is your name? ")
print(f"Hello, {name}!")
```
Author guidance appears in tip boxes:
::: {.callout-tip title="What to Look For"}
Your AI should explain that lists are ordered by position and dictionaries are ordered by key.
:::
## How This Book Was Written
This book was written through human-AI collaboration using the methodology it teaches. The structure, pedagogy, and editorial decisions were made by the author. Claude (Anthropic) assisted with drafting and refining. The process demonstrates the book's core message: AI is most useful when you understand what you are asking it to do.
## Ways to Engage with This Book
- **Read it online.** The full book is freely available at the companion website, with dark mode, search, and navigation.
- **Read it on paper or e-reader.** Available as a paperback and ebook through Amazon KDP.
- **Converse with it.** The online edition includes a chatbot grounded in the book's content.
- **Feed it to your own AI.** The `llm.txt` file provides a clean text version of the entire book, ready to paste into ChatGPT, Claude, or any AI tool.
- **Run the code.** Project code is available on [GitHub](https://github.com/michael-borck/code-python-consult-ai). [DeepWiki](https://deepwiki.com/michael-borck/code-python-consult-ai) provides an AI-navigable view of the repository.
- **Browse all books.** This book is part of a series. See all titles at [books.borck.education](https://books.borck.education).
The online version is always the most current.
### Source Code & Feedback
All code examples and supplementary materials are available at:
https://github.com/michael-borck/code-python-consult-ai
Found an error? Have a suggestion?
- Open an issue: https://github.com/michael-borck/code-python-consult-ai/issues
- Email: michael@borck.me
## The Series
This book is part of a series designed to help you master modern software development in the AI era.
::: {.content-hidden when-format="epub"}
```{mermaid}
%%| fig-width: 4
flowchart TD
CND["Conversation,<br/>Not Delegation"]
CPPA["Converse Python,<br/>Partner AI"]
Think["Think Python,<br/>Direct AI"]
Code["Code Python,<br/>Consult AI"]
Ship["Ship Python,<br/>Orchestrate AI"]
Web["Build Web,<br/>Guide AI"]
CND --> CPPA
CND --> Web
CPPA --> Think
Think --> Code
Code --> Ship
```
:::
**Conversation, Not Delegation**. The general methodology for working with AI across any discipline.
**Converse Python, Partner AI**: intentional prompting methodology applied to software development.
**Think Python, Direct AI**: computational thinking for absolute beginners.
**Code Python, Consult AI** (this book). Python fundamentals through AI conversation.
**Ship Python, Orchestrate AI**: professional Python development practices and tooling.
**Build Web, Guide AI**: web development with AI as your development partner.
All titles are available at [books.borck.education](https://books.borck.education).