Learn AI-assisted Python Programming, Second Edition

本网站不提供下载链接,喜欢看书的朋友请关注公众号:【lennylee的碎碎念】(lennyleede),首页回复:授人以渔,自动获取搜索资源的方法。

内容简介:

Whether you know Python or not, this book will help you write amazing Python code using the latest versions of Copilot or ChatGPT.

无论你是否了解 Python,本书都能帮助你使用最新版本的 Copilot 或 ChatGPT 写出令人惊叹的 Python 代码。

Once, to be a programmer you had to write every line of code yourself. Now tools like GitHub Copilot can instantly generate working programs based on your description in plain English. An instant bestseller, Learn AI-Assisted Python Programming has taught thousands of aspiring programmers how to write Python the easy way—with the help of AI. It’s perfect for beginners, or anyone who’s struggled with the steep learning curve of traditional programming.

曾经,要成为一名程序员,你必须亲自编写每一行代码。现在,像 GitHub Copilot 这样的工具可以根据你的描述,用简单的英语立即生成可运行的程序。作为一本畅销书,《学习人工智能辅助 Python 编程》已经教会了成千上万有抱负的程序员如何在人工智能的帮助下轻松编写 Python 程序。它非常适合初学者,或者任何在传统编程的陡峭学习曲线中挣扎过的人。

In Learn AI-Assisted Python Programming, Second Edition you’ll learn how to:

在《学习人工智能辅助 Python 编程》(第二版)中,您将学习如何:

– Write fun and useful Python applications—no programming experience required!

编写有趣实用的 Python 应用程序–无需编程经验!

– Use the GitHub Copilot AI coding assistant to create Python programs

使用 GitHub Copilot AI 编码助手创建 Python 程序

– Write prompts that tell Copilot exactly what to do

编写提示,告诉 Copilot 具体要做什么

– Read Python code and understand what it does

阅读 Python 代码并理解其作用

– Test your programs to make sure they work the way you want them to

测试您的程序,确保它们能按您的要求运行

– Fix code with prompt engineering or human tweaks

通过及时的工程或人工调整修复代码

– Apply Python creatively to help out on the job

创造性地应用 Python 来帮助工作

AI moves fast, and so the new edition of Learn AI-Assisted Python Programming, Second Edition is fully updated to take advantage of the latest models and AI coding tools. Written by two esteemed computer science university professors, it teaches you everything you need to start programming Python in an AI-first world. You’ll learn skills you can use to create working apps for data analysis, automating tedious tasks, and even video games. Plus, in this new edition, you’ll find groundbreaking techniques for breaking down big software projects into smaller tasks AI can easily achieve.

人工智能发展迅速,因此新版《学习人工智能辅助 Python 编程》(第二版)全面更新,以利用最新的模型和人工智能编码工具。本书由两位受人尊敬的计算机科学大学教授撰写,教你在人工智能优先的世界里开始 Python 编程所需的一切。您将学习到用于创建工作应用程序的技能,这些应用程序可用于数据分析、自动化繁琐的任务,甚至视频游戏。此外,在新版中,你还会发现将大型软件项目分解为人工智能可以轻松完成的较小任务的突破性技术。

about the technology 关于技术

The way people write computer programs has changed forever. Using GitHub Copilot, you describe in plain English what you want your program to do, and the AI generates it instantly.

人们编写计算机程序的方式发生了翻天覆地的变化。使用 GitHub Copilot,你只需用简单的英语描述你想让程序做什么,人工智能就会立即生成。

about the book 关于本书

This book shows you how to create and improve Python programs using AI—even if you’ve never written a line of computer code before. Spend less time on the slow, low-level programming details and instead learn how an AI assistant can bring your ideas to life immediately. As you go, you’ll even learn enough of the Python language to understand and improve what your AI assistant creates.

本书告诉你如何使用人工智能创建和改进 Python 程序–即使你以前从未编写过一行计算机代码。少花时间在缓慢、低级的编程细节上,而是学习人工智能助手如何将你的想法立即变为现实。在学习的过程中,你甚至可以学到足够多的 Python 语言来理解和改进你的人工智能助手所创建的程序。

what’s inside 主要内容

– Prompts for working code

提示工作代码

– Tweak code manually and with AI help

在人工智能的帮助下手动调整代码

– AI-test your programs

对程序进行人工智能测试

– Let AI handle tedious details

让人工智能处理繁琐细节

about the reader 目标读者

If you can move files around on your computer and install new programs, you can learn to write useful software!

如果你能在电脑上移动文件并安装新程序,你就能学会编写有用的软件!

作者简介:

Learn AI-Assisted Python Programming, Second Edition
0 Praise for the First Edition
0.1 copyright
0.2 dedication
0.3 contents
0.4 foreword
0.5 acknowledgments
0.6 introduction
0.6.1 AI assistants change how programming is done
0.6.2 Audience
0.6.3 What we expect from you
0.6.4 What you will be able to do after reading this book
0.6.5 The challenge in working with AI assistants
0.6.6 Why we wrote this book
0.6.7 Warning: Beware of elitism
0.6.8 How this book is organized: A road map
0.6.9 Source code downloads
0.6.10 Software/hardware requirements
0.6.11 liveBook discussion forum
0.7 about the authors
0.8 about the cover illustration
1 Introducing AI-assisted programming with GitHub Copilot
1.1 Improving how we talk to computers
1.1.1 Making it a little easier
1.1.2 Making it a lot easier
1.2 About the technology
1.2.1 Python, your programming language
1.2.2 GitHub Copilot, your AI assistant
1.2.3 How Copilot works behind the scenes—in 30 seconds
1.3 How Copilot changes how we learn to program
1.4 What else can Copilot do for us?
1.5 Risks and challenges when using Copilot
1.6 The skills we need
1.7 Societal concerns about AI code assistants like Copilot
Summary
2 Getting started with Copilot
2.1 Setting up your computer to start learning
2.2 The software we’ll be using
2.2.1 Python
2.2.2 Visual Studio Code
2.2.3 GitHub account
2.3 Getting your system set up: Part 1
2.4 Working with Python in Visual Studio Code
2.4.1 Set up your working folder
2.4.2 Check to see if your setup is working properly
2.5 Writing and running some small programs
2.6 Getting your system set up: Part 2
2.6.1 Check to see if Copilot is working properly
2.7 Addressing common Copilot challenges
2.8 Our path forward
2.8.1 How we’ll be working with Copilot throughout the book
2.8.2 Showcasing Copilot’s value in a data processing task
Summary
3 Designing functions
3.1 Functions
3.1.1 The components of a function
3.1.2 Using a function
3.2 The design cycle of functions with Copilot
3.3 Examples of creating good functions with Copilot
3.3.1 Dan’s stock pick
3.3.2 Leo’s password
3.3.3 Getting a strong password
3.3.4 Scrabble scoring
3.3.5 The best word
3.4 Benefits of functions
3.5 Roles of functions
3.6 What’s a reasonable task for a function?
3.6.1 Attributes of good functions
3.6.2 Examples of good (and bad) leaf functions
3.7 Exercises
Summary
4 Reading Python code: Part 1
4.1 Why we need to read code
4.2 Asking Copilot to explain code
4.3 Top 10 programming features you need to know: Part 1
4.3.1 #1. Functions
4.3.2 #2. Variables
4.3.3 #3. Conditionals
4.3.4 #4. Strings
4.3.5 #5. Lists
4.4 Exercises
Summary
5 Reading Python code: Part 2
5.1 Top 10 programming features you need to know: Part 2
5.1.1 #6. Loops
5.1.2 #7. Indentation
5.1.3 #8. Dictionaries
5.1.4 #9. Files
5.1.5 #10. Modules
5.2 Exercises
Summary
6 Testing and prompt engineering
6.1 Why it’s crucial to test code
6.2 Closed-box and open-box testing
6.2.1 Closed-box testing
6.2.2 How do we know which test cases to use?
6.2.3 Open-box testing
6.3 How to test your code
6.3.1 Testing using the Python prompt
6.3.2 Testing in your Python file (we won’t be doing it this way)
6.3.3 doctest
6.4 Revisiting the cycle of designing functions with Copilot
6.5 Full testing example
6.5.1 Finding the most students we can add to a row
6.5.2 Improving the prompt to find a better solution
6.5.3 Testing the new solution
6.6 Another full testing example: Testing with files
6.6.1 What tests should we run?
6.6.2 Creating the function
6.6.3 Testing the function
6.6.4 Common challenges with doctest
6.7 Exercises
Summary
7 Problem decomposition
7.1 Problem decomposition
7.2 Small examples of top-down design
7.3 Spelling suggestions
7.4 Spelling suggestions using top-down design
7.5 Breaking down the process subproblem
7.5.1 Getting the list of words from the word list file
7.5.2 Generating the list of all possible words
7.5.3 Generating the list of all real words
7.6 Summary of our top-down design
7.7 Implementing our functions
7.7.1 create_word_list
7.7.2 add_letter
7.7.3 delete_letter
7.7.4 change_letter
7.7.5 all_possible_words
7.7.6 all_real_words
7.7.7 get_spelling_suggestions
7.7.8 spell_check
7.8 Exercises
Summary
8 Debugging and better understanding your code
8.1 What causes errors (bugs)?
8.2 How to find the bug
8.2.1 Using print statements to learn about the code behavior
8.2.2 Using VS Code’s debugger to learn about the code behavior
8.3 How to fix a bug (once found)
8.3.1 Asking Copilot to fix your bug via Copilot Chat
8.3.2 Giving Copilot a new prompt for the whole function
8.3.3 Giving Copilot a targeted prompt for part of a function
8.3.4 Modifying the code to fix the bug yourself
8.4 Modifying our workflow in light of our new skills
8.5 Applying our debugging skills to a new problem
8.6 Using the debugger to better understand code
8.7 A caution about debugging
8.8 Exercises
Summary
9 Automating tedious tasks
9.1 Why programmers make tools
9.2 How to use Copilot to write tools
9.3 Example 1: Cleaning up email text
9.3.1 Conversing with Copilot
9.3.2 Writing the tool to clean up email
9.4 Example 2: Adding cover pages to PDF files
9.4.1 Conversing with Copilot
9.4.2 Writing the tool
9.5 Example 3: Merging phone picture libraries
9.5.1 Conversing with Copilot
9.5.2 Top-down design
9.5.3 Writing the tool
9.6 Exercises
Summary
10 Making some games
10.1 Game programs
10.2 Adding randomness
10.3 Example 1: Bulls and Cows
10.3.1 How the game works
10.3.2 Top-down design
10.3.3 Parameters and return types
10.3.4 Implementing our functions
10.3.5 Adding a graphical interface for Bulls and Cows
10.4 Example 2: Bogart
10.4.1 How the game works
10.4.2 Top-down design
10.4.3 Implementing our functions
10.5 Exercises
Summary
11 Creating an authorship identification program
11.1 Authorship identification
11.2 Authorship identification using top-down design
11.3 Breaking down the process subproblem
11.3.1 Figuring out the signature for the mystery book
11.4 Summary of our top-down design
11.5 Implementing our functions
11.5.1 clean_word
11.5.2 average_word_length
11.5.3 different_to_total
11.5.4 exactly_once_to_total
11.5.5 split_string
11.5.6 get_sentences
11.5.7 average_sentence_length
11.5.8 get_phrases
11.5.9 average_sentence_complexity
11.5.10 make_signature
11.5.11 get_all_signatures
11.5.12 get_score
11.5.13 lowest_score
11.5.14 process_data
11.5.15 make_guess
11.6 Going further
11.7 Exercises
Summary
12 Future directions
12.1 Prompt patterns
12.1.1 Flipped interaction pattern
12.1.2 Persona pattern
12.2 Limitations and future directions
12.2.1 Where Copilot (currently) struggles
12.2.2 Is Copilot a new programming language?
12.3 Exercises
Summary
index
· · · · · · (收起)

原文摘录: