## Summary ## 本章小结 * We need to be able to read code to determine whether it is correct, test it effectively, and write our own code when needed. * The Copilot Labs Extension can provide line-by-line explanations of code to explain to you what the code is doing. * Python has built-in functions such as `max`, `input`, and `print` that we call just like we call our own functions. * A variable is a name that refers to a value. * An assignment statement makes a variable refer to a specific value. * An `if` statement is used to have our programs make decisions and proceed down one of multiple paths. * A string is used to store and manipulate text. * A method is a function associated with a particular type. * A list is used to store and manipulate a general sequence of values (like a sequence of numbers or a sequence of strings). * Each value in a string or list has an index; indexing starts at 0, not 1. * Strings are immutable (not changeable); lists are mutable (changeable). <!-- --> * 能够阅读代码是判断代码是否正确、有效测试代码,以及在需要时编写自己代码的关键能力。 * Copilot 实验室扩展能提供代码的逐行解释,向你阐明代码的具体操作。 * Python 具有像 `max`、`input` 和 `print` 这样的内置函数,我们调用这些函数的方式就像调用我们自己定义的函数一样。 * 变量是引用值的名字。 * 赋值语句让变量指向了一个具体的值。 * `if` 语句用于让我们的程序进行决策,并选择多条路径中的一条继续执行。 * 字符串用来存储和操作文本。 * 方法是与特定类型相关的函数。 * 列表用来存储和操作一系列值(比如数字序列或字符串序列)。 * 字符串或列表中的每个值都对应一个索引,这个索引从 0 开始计数,而不是从 1 开始。 * 字符串是不可变的(不可以修改);而列表是可变的(可以修改)。
Activity