The third thing I'm going to do, is I need to set up the right end test.
我要做的第三件事情,就是需要设置正确的完结测试。
Another situation where you would use the "you have to" pattern is when you express what you don't have to do.
另一种使用“you have to”句型的情况是要表达那些不需要做的事情。
But the string, the sentence or the words that we're displaying on the screen, previously you clicked on a little white text field and typed it in, well now you're gonna do the same thing at the keyboard but you're gonna have to sandwich it in between double quotation marks.
这些你想输出到屏幕上的字符串啊,语句啊,单词啊,或者你事先,在白色输入框中敲进去的内容,现在你们需要用键盘做同样的事情,但是你们要写在,双引号之间。
OK. Second thing I need to do, though, is I need to, when I get those values, I want to hang on to them.
好,我需要做的第二件事情,就是我需要去,当我得到这些值后,我想抓住这些值。
Even in real recipes, you have things like, if needed, add sugar.
就算在真实的菜谱当中,你也需要做一些比如加糖之类的事情。
Programmers often write TODO with no space, all caps like this which means "I have to do something here."
程序员通常写TODO不使用空格,像这样的大写意思是“这里我需要做些事情“
And the thing I wanted point out is, we've got this global variable number of calls. Which is there not because Fibonacci needs it but just for pedagogical reasons, so that we can keep track of how much work this thing is doing.
要指出的是我们已经,调用了几次这个全局变量,这不是因为斐波那契数列,需要调用它而只是,因为教学上的需要,以便我们可以知道,这个函数做了多少事情。
Because this is something that could certainly have screwed you up if you didn't realize it did it, and you need to have that discipline to make sure it's doing the right thing.
因为这是一件如果你没意识到,要这么做的话,可能会令你抓狂的一件事,你需要一个规范,来确定Python做了正确的事情。
And just as with variables, you should use some common sense, some style here, and the function's name should X Y communicate what it does, calling it X or Y or Z is generally not all that helpful.
就像变量,你使用一些常识,一些类型,和函数名需要,传达它所做的事情,把它叫做,或者Z通常是没有什么用处的。
应用推荐