cssmagic/Learn-AI-Assisted-Python-Programming

[译] [500] 第五章 理解 Python 代码(下)

cssmagic opened this issue · 1 comments

5 Reading Python Code: Part 2

第五章 理解 Python 代码(下)

This chapter covers

本章内容概要

  • Repeating code the required number of times using loops
  • Using indentation to tell Python which code goes together
  • Building dictionaries to store pairs of associated values
  • Setting up files to read and process data
  • Adding modules to extend Python into new domains
  • Asking Copilot to explain code
  • 使用循环实现代码的指定次数重复
  • 用缩进标识哪些代码是一组
  • 建立字典来保存一对一关联的值
  • 设置文件读取和处理数据
  • 添加模块,使 Python 拓展到新的领域
  • 要求 Copilot 对代码进行解释

In Chapter 4, we explored five Python features that you’re going to see all the time as you continue in your programming journey: functions, variables, conditionals (if statements), strings, and lists. You need to know those features to read code, and we explained why being able to read code is important whether or not we’re using Copilot.

在第四章中,我们探索了在编程之旅中频繁出现的五个 Python 特性:函数、变量、条件(if 语句)、字符串和列表。理解这些功能对阅读代码非常重要,我们还解释了无论是否使用 Copilot,阅读代码的能力都相当重要。

We’re going to continue in this chapter with five more Python features, which will round out our top 10. As in Chapter 4, we’ll do this through a combination of our own explanations, explanations from Copilot, and experimenting at the Python prompt.

本章,我们将继续深入另外五个 Python 功能,使我们的重点功能总数达到十个。与第 4 章的做法一样,我们将通过自己的讲解、Copilot 的解释和在 Python 提示符下进行实验的方式来实现这一目标。


本章目录

  • 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.1 你必须掌握的十大编程特性:第二部分
    • 5.1.1 #6. 循环
    • 5.1.2 #7. 缩进
    • 5.1.3 #8. 字典
    • 5.1.4 #9. 文件
    • 5.1.5 #10. 模块

本章正文略。如需阅读,请购买正版。


👉 想要更多译稿预览,请前往 总目录 中按章节阅读。