• But imagine I actually wanted to gather them together. I wanted to collect them, so I could do something with them.

    把那些除数都显示出来,这很有用,但是请想想下我想要,把它们放在一块。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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.

    那么这到底跟我的除数的例子有什么关系呢?,好,实际上,在我讲之前请我先来补充一点,大家还记得我说过,我们可以概念上认为。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Again, same kind of reasoning says, given some value x, I happened to pick a small one here, what's an easy way to do this? Well, let's just start at one. That's my variable I'm going to change and check.

    好,尤其是,让我们到这里来,让我给大家看看第二个例子,让我把这个注释掉,这是我要解决的,第二个问题,假设我想找到一些整数的,所有除数,我想要找出来这个数的所有的除数

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I shouldn't say list, those two tuples, and walk through them to find the pieces that match up.

    除数数组进行对比,我不该说数组的,是元组,遍历这两个元组找到相同的元素。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I could go in and say give me the fourth divisor, give me the second through fifth divisor.

    第四个除数,给我第二个到第五个除数

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Right now, what my code is doing is, it's printing them up for me, which is useful.

    它的所有的除数,现在,我的代码要做的就是。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • You'll see why I'm going to make that distinction in a couple of lectures.

    为什么我要把这个区分开来,好,那么这跟我的除数例子有什么关系呢?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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.

    这意味着我可以创建元组了,但是想像下回到我们的除数的例子,在处理过程中我们想把目标数的除数,收集起来,我应该能够通过把这些数,一个一个加进来来实现这个目的,我正是要去这么做,也就是。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I'm going to give a name to that. And what you see there is I'm going to call divisors initially an empty tuple, something has nothing in it. Right here. And then I'm going to run through the same loop as before, going through this set of things, doing the check.

    你们可以看到这里,我初始化一个空的元组,名为divisiors,这里,然后我会去运行,跟以前一样的循环,遍历这个集合内的东西,然后做检查,现在我要做的是,每次我找到了一个除数我要把它收集起来。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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循环,重新写我们那个求平方数的程序,我想要做的是,是继续-哦抱歉,回到-我的除数那个例子。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定