Now, what did I want to do? I wanted to check membership. I want to do search. Well that's simple. Given that representation and some value, I just say gee is it there?
现在,我需要做什么?,我要做成员检查,我要做查找,这就很简单了,给了即定的表示和一些值,我只需要说喂在那儿吗?
The dentist said gee I don't know I'll look at my records.
牙医说,哎呀,我不知道,我去看看我的记录。
Right. If you look at the rest of that code, gee, it looks a lot like what I had elsewhere.
好了如果你看看剩下的代码,天呐,看上去就像我在别的地方写过的。
There will be millions of kids out there now that say "Gee, I'd like to learn to play the violin too."
如今会有成数以百万计的孩子,会说,"哇,我也要学小提琴"
So, if there is one section of the lecture that I went a little too quickly for, you could say, gee, if I could just see that five minutes, you could click on it, zoom into that five minutes, play it a few times, and then say, I still don't know what he's talking about.
所以,如果有那节课,我上得过快,你可以说,天啊,我多希望我能看到那5分钟,你就能点击它,选择那五分钟,播放几次,然后说,我还是不知道他在说什么。
We have no concern or hesitation in saying what plastic is, and so we say, "Oh, gee. Well, I guess the great creator has a sort of a prosthetic limb and he raised it. All right.
我们能毫不迟疑地说出塑料是什么,所以我们说,哎呀,我猜造物主,装了义肢,还将它抬了起来,好。
And there are many people in sort of common sense who might think "Gee, if only I could just use my rationality, think reasonably and rationally and not let my emotions guide my behavior I'd be much better off."
有许多有常识的人,也许会想,要是我能用我的理性,合理思考,不让情感指导行为,我会做得更好“
Notice one last piece. If I'm going to do that, run through all possible answers, I still want to know, gee, what if there aren't any answers? How do I return that case?
注意最后一段,如果我要这样做,也就是运行所有可能的答案,我还是想知道要是没有结果呢?,在这个例子中应该返回什么呢?
Thing I've got a little procedure that could do that, but you know the simplest thing I could do is to say well, gee, wait a minute, why don't I just check to see if these are the same thing?
这两个点是同一个点么?,我已经写了一小块代码,可以提供这个功能,但是你知道的我可以做的,最简单的事情就是说好,嗯?,等等,我为什么不直接去看看,这两个东西相等不相等呢?
Gee, I wonder if I could come up with a set of transitions occurring inside atomic hydrogen Just right match that what Angstrom measured back in 1853.
嘿!我想知道我是否可以想出,发生在氢原子内的,一系列的跃迁,正好符合,阿姆斯特朗在1853年测得的东西。
Well I have to go to the zero-th element, and say OK, gee, to get to the next element, I've got to jump this here. And to get to the next element, I've got to jump to here, and to get to the next element, I've got to jump to here, until I get there.
再回到第0个元素,好的,然后找下一个元素,跳转到这里,然后再下一个元素,跳到了这里,然后再下一个元素,直到我找到那个元素,这样,我有方法来保存变长的元素。
Gee, you know, I showed you this earlier.
天哪,你知道,我之前给你们展示过了。
All right? If I'm gambling, I'm saying, gee, if I'm really lucky, it'll be only on this side, and I've got a little bit of work to do, but if I'm unlucky, I'm scrawed, the past pluperfect of screwed, OK., or a Boston fish.
如果我够幸运的话,目标数就会在这边的,这会大大减少我的工作量,但如果不幸运呢?我就完蛋了,我就得再从剩下的这么大的数组里找了,这很痛苦,因此选中位数是正确答案。
the same as polar point 2, polar point 1 And then I could say well, gee, are they the same point?
和另外一个极坐标点,我如果来试试,和polar,point,2是不是相同的话?
And the code over here says, OK gee, if I'm in the base case do something.
如果我属于基础事件就进行一些操作,而我不是,所以往下看这儿。
If I look for, say, minus 1, you might go, gee, wait a minute, if I was just doing linear search, I would've known right away that minus one wasn't in this list, because it's sorted and it's smaller than the first elements.
如果我要查找-1,你可能要怒了,呵呵,等一等,如果我用的是线性查找,我不会知道-1不在这个列表中,但是列表是排好序的,1又比第一个元素小。
It says, well I'm going to print out first and last just so you can see it, and then I say, gee 2 if last minus first is less than 2, that is, if there's no more than two elements left in the list, then I can just check those two elements and return the answer.
然后它计算了尾点和开始点的差,如果小于2的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
It's looking at the i'th and the i plus first element and it's saying, gee, if the i'th element is bigger than the i'th plus first element, what's the next set of three things doing?
他在观察第i个元素,和第i+1个元素,如果第i个元素大于第i+1个元素,接下来的要做哪三件事情?
If I wanted to use print as a variable name, how do I get the system to decide gee, do I want print as a value for something, or do I want print as a command?
如果我把print当做一个变量名,我如何让系统来决定,我是要把print当做一个命令来用呢,还是要把它当做一个变量名来用呢?
I'm going to say, gee, p2 is the x value the same in both of them, and if it is, and the y value's the same, then this is the same point, I'm going to return true.
这样的数据对象,我会把它们命名为p1和,我会去查看,看看两个对象中,的x值是不是相同,如果相同的话,就去查看y值是否相同。
Now, you might have said, gee, why didn't it just assume that I wanted to in fact treat these as strings, and combine them together?
现在,你们可能会认为,伊,为什么Python不假设,我实际上想把这些对象当做字符串一样对待,然后把它们组合到一起呢?
So the question was, why is this return down at this level, it says, well if I ever execute out of this FOR loop, I get to the end of the FOR loop without hitting that branch that took me through the return, then and only then do I want to actually say, gee, I got to this place, there isn't any value to return, none I'm going to return none and none.
问题是,为什么它是在这个级别上返回值呢,意思就是如果我出了这个for循环,就意味着我运行的过程中没有走到任何,带return的支路上去,这时也只有这时我才能说天呐,我终于走到这儿了,这时不会返回任何值,只会返回none和。
应用推荐