What computing is
Python for AP CS Principles Lesson 1 2:07 English narration · English + 中文 subtitles burned in
Chapters
Transcript
A program is a set of instructions a computer follows, and almost every one of them has this shape.
程序是一组计算机会照着执行的指令, 而几乎每一个程序都是这个形状。
Input: data goes in — a number you type, a tap, a file.
输入:数据进来——你敲的一个数字、一次点击、一个文件。
Process: the program does work on that data.
处理:程序对这些数据做事情。
Output: a result comes out.
输出:一个结果出来。
And every program is built for a reason: to solve a problem, or help people do something.
而每个程序都是为了某个理由而做的: 为了解决一个问题,或者帮人做成一件事。
Here is a three-line program, and each line is one of the three parts.
这是一个三行的程序,而每一行正好是三个部分中的一个。
Line one asks for a name — that is the input.
第一行要一个名字——那是输入。
Line two glues the name onto a greeting — that is the process.
第二行把名字接到问候语上——那是处理。
Line three prints it — that is the output.
第三行把它打印出来——那是输出。
Once you can see this shape, you can see it in almost any program you meet.
一旦你能看出这个形状, 你几乎在任何遇到的程序里都能看出它。
Good programs are not written perfectly the first time.
好程序不是第一次就写得完美的。
Instead you plan, write, test, improve — and then repeat, going round again a little better each time.
而是:先计划,再写,再测试,再改进—— 然后重复,再走一圈,每一圈都好一点。
That is what iterative means.
这就是"迭代"的意思。
And errors are not a sign you did something wrong; finding and fixing bugs is part of every step of that cycle.
而出错并不说明你做错了什么; 找出并修好 bug,是这个循环里每一步的一部分。
One more thing before we start, because it is how the whole course is organised.
开始之前还有一件事,因为整门课就是按它组织的。
AP CSP is built on five Big Ideas: Creative Development, Data, Algorithms and Programming, Computer Systems and Networks, and the Impact of Computing.
AP CSP 建立在五大核心概念上: 创造性开发、数据、算法与编程、 计算机系统与网络,以及计算的影响。
Every lesson here belongs to one of them, and so does every exam question.
这门课的每一课都归属于其中之一, 每一道考题也是。
Four things to take with you.
带走四点。
One: a program is instructions written for a purpose.
第一:程序是为了某个目的而写下的指令。
Two: input, process, output is the shape of nearly all of them.
第二:输入、处理、输出是它们绝大多数的形状。
Three: design is a cycle — plan, write, test, improve, repeat.
第三:设计是一个循环——计划、编写、测试、改进、再来一轮。
Four: computing is collaborative, and bugs are normal.
第四:计算是协作的,而 bug 是常态。
Now write a tiny input-process-output program in the task below.
现在去下面的题里写一个小小的"输入—处理—输出"程序。