What in the world does that have to do with my divisor example? Well, actually, before I do that let me in fact fill in a piece here.
那么这到底跟我的除数的例子有什么关系呢?,好,实际上,在我讲之前请我先来补充一点,大家还记得我说过,我们可以概念上认为。
I could go in and say give me the fourth divisor, give me the second through fifth divisor.
第四个除数,给我第二个到第五个除数。
Now what I'd like to do, every time I find a divisor I'd like to gather it together. So I'm going to create a tuple of one element, the value of i.
那么我就会去创建只包含一个元素的元组,也就是这个除数了,然后,啊,很好,这里是加法重载的一个很糟糕的应用。
All right. What does this have to do with my divisor example? This says I can make tuples, but imagine now going back to my divisor example and I want to gather up the elements as I go along. I ought to be able to do that by in fact just adding the pieces in.
这意味着我可以创建元组了,但是想像下回到我们的除数的例子,在处理过程中我们想把目标数的除数,收集起来,我应该能够通过把这些数,一个一个加进来来实现这个目的,我正是要去这么做,也就是。
And if I were to use that again, I'd just put it on your handout, I could go back and rewrite that thing that I had previously for finding the square roots of the perfect squares, just using the FOR loop. OK. What I want to do, though, is go on to-- or, sorry, go back to - my divisor example.
它可以是任意的集合,如果我又要去用这个方法的话,我会把它放在你们的课堂手册上的,我可以回过头去用FOR循环,重新写我们那个求平方数的程序,我想要做的是,是继续-哦抱歉,回到-我的除数那个例子。
应用推荐