I am going to emphasize what you perhaps did anticipate that he would say, so that can take us along rather smoothly.
我会重点讲你可能已经预想到的他会说的东西,这样我们就可以顺利地把课程进行下去。
So you say, how can I make money beating the market if every quarter I have to tell everybody what I'm doing?
因此你会说,如果我按季度公布所有的投资活动,那我还怎么跑赢市场赚取利润
So if we asked you which of these two things is food, I can imagine what you'd say.
如果问你这两个中哪个是食品,我能想象你们的答案
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的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
So you can actually say, how do I know which methods are associated with the class? For that, we can call dir. And what it does, is it gives me back a listing of all the things, dir all the methods, that are associated with it.
我们开始建立类了,我们得到了这些方法,因此实际上你可以说,我怎么知道,哪些方法是关联与这些类的?,为了解决这个问题,我们可以调用,这个方法的作用。
应用推荐