Skip to content

[译] [404] 本章小结 #26

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
cssmagic opened this issue Feb 29, 2024 · 0 comments
Open

[译] [404] 本章小结 #26

cssmagic opened this issue Feb 29, 2024 · 0 comments

Comments

@cssmagic
Copy link
Owner

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 具有像 maxinputprint 这样的内置函数,我们调用这些函数的方式就像调用我们自己定义的函数一样。
  • 变量是引用值的名字。
  • 赋值语句让变量指向了一个具体的值。
  • if 语句用于让我们的程序进行决策,并选择多条路径中的一条继续执行。
  • 字符串用来存储和操作文本。
  • 方法是与特定类型相关的函数。
  • 列表用来存储和操作一系列值(比如数字序列或字符串序列)。
  • 字符串或列表中的每个值都对应一个索引,这个索引从 0 开始计数,而不是从 1 开始。
  • 字符串是不可变的(不可以修改);而列表是可变的(可以修改)。
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant