• It is going to give me back a tuple a collection of two things, and so check out the syntax.

    它将给我返回一个数组或者系列的一对,然后检查一下语法。

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

  • Literally, return the control from this function, and take the value of the next expression, and return that as the value of the whole computation.

    正如字面意义上说的,从这个函数返回,然后取得下一个表达式的,并把这个作为整个计算的结果返回

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

  • 4 So even if the correct mathematical answer is 1.4 or whatever, when you divide an int by an int, you only have room in that variable, in the response for an actual integer.

    所以即使那个正确的答案是4,或别的数,当你用一个整型数除以一个整型数,在那个变量的返回值里,只有,存储一个整型数的空间。

    哈佛公开课 - 计算机科学课程节选

  • false It's going to return true if it's a PAIL-indrome and false if it's a PAL-indrome. And it says true. Now maybe you're bugged by this.

    如果不是会问的话则是,返回的是真,那么你可能会觉得这个很烦。

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

  • So you're implementing this black box, and if its purpose in life is to actually return a value, you have to tell the compiler what kind of value to expect, and this is going to have ripple effects.

    你在实现这个黑盒子,如果它的目的是,返回一个,你必须告诉编译器你期望的是什么类型的,这个将是一个连锁反应。

    哈佛公开课 - 计算机科学课程节选

  • Because it says, your program will still give you a value, but it may not be what you intended, and you can't always tell, and that may propagate it's way down through a whole bunch of other computations before it causes some catastrophic failure.

    因为这意味着,你的程序依然会返回一个,但是这个可能不是你想要的,你可能还分辨不出来,而且这种情况会传播,结果会沿着正果计算过程传播下去,直到产生一个灾难性的错误。

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

  • But it's a valuable thing. It says, in each case, I return some useful value from this procedure.

    但是这就是变量,是在每个例子中,我从这个程序中返回了一些有用的

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

  • When solve is done, it wraps up, if you like, a value that it returns. Which is that.

    如果你喜欢的话可以返回一个,就是这个。

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

  • It's totally legit to cull a function, get back a value, do nothing with it other than compare it to another value.

    挑选一个函数是完全合法的,返回一个,用它来做些事情而不是用它与其它的比较。

    哈佛公开课 - 计算机科学课程节选

  • And if it returns a value, you've got to do something with that return value too, much like we did up here.

    如果它返回了一个,你便用那个返回值,做一些事情,就像我们刚在上面做的。

    哈佛公开课 - 计算机科学课程节选

  • I can use that to return values, which I can then use elsewhere, which I did-- and if I just come back and highlight this-- inside of that computation.

    我可以用它来返回值,然后我可以在别的地方使用这些返回值,正是我做的--如果我回过头来,在高亮一下这个--在这部分计算内部。

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

  • Something that takes two inputs, a left operant - and a right operant and it just returns a Boolean value is-- or rather it returns a left to right value.

    它有两个输入,一个是左边的作用物,一个是右边的作用物,然后返回一个布尔-,或者更确切地说,返回一个从左到右的

    哈佛公开课 - 计算机科学课程节选

  • PROFESSOR: And so in this case, it's using the same piece, but it's returning that middle value that says they're actually the same.

    教授:那么实际在这个例子中,我们用的是同一个函数,它返回了中间的也就是,0来表明着两个参数。

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

  • And then the only other difference is obviously, it's a function I need to return a value.

    然后还剩下一点明显的区别,对于方法我要有返回值

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

  • And so, in fact, if I wanted the other version of it, in fact, if I do this right, 23 it's going to give me 23 because it does the multiplication first, if I wanted the other version of it, Python I need to tell it that, by using, excuse me, parentheses.

    因此,实际上,如果我想换种做法,实际上,如果我去执行这个表达式,返回值是3,因为乘法会被优先执行,如果我需要换种做法,我需要告诉,用括号来告诉它。

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

  • I can give two names, which will get bound to the two parts of that return tuple.

    我可以给它设两个变量,返回的一对将会被赋给这两个变量。

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

  • I don't have to go read what it printed out in the screen. This has returned a value that I can use. Because I could do a test to say, is this a return value? If it's not, I'll do something else with it. So the binding is still there, it simply doesn't print it out.

    我不想读到屏幕中打印出来的这行字,程序返回过一个我能够使用的,因为我可以做个小测试,来说明这是否是返回,如果不是,我可以做一些其它的事,而这个绑定依然在这儿,没有打印任何东西。

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

  • You know when you add 2 polar forms, you add the radii together, you don't add the angles together, you need to do it in Cartesian form.

    表示形式的不同理解,返回给你了不同的,这也就带来了一系列的问题,第二个问题是。

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

  • So I can similarly do this, which is going to look strange because it's going to give me the same value back out, but it actually did a slightly different thing.

    我也可以通过类似的手段来达到这个目的,这看起来很奇怪,但是会返回相同的,但是它的实现真的有点不同。

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

  • Second thing we saw is, that using this as a computation, I can return multiple values.

    我们看到的第二件事是把它用作计算,我可以返回多个

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

  • Notice by the way, there's that nice speck true going on saying put a string here.

    在这里说放一个字符串在这儿有点小问题,如果是回文的话那么它将会返回

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

  • They only need to have values if you care GetInt about getting something back from them, get int, swap you care about its value; but swap, I don't want to hear it again.

    它们只需要拥有,如果你关心,它们的返回值,你关心它的返回值,但是,我不想再得到它的返回

    哈佛公开课 - 计算机科学课程节选

  • The prototype is just its return value, its name, and its arguments, if any.

    原型就是他的返回值,它的名字,它的参数之类的。

    哈佛公开课 - 计算机科学课程节选

  • So there's a return branch on every possible path through the code. And that's valuable, it's something you want to think about as your right your own.

    所以代码中每条可能的路径,都会有一个返回值分支,这是非常有价的,当你自己写程序的时候也应该考虑这件事。

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

  • The only thing that you have to put in the function prototype, ; again, is three things; one, the name of the function; the return value; and its arguments.

    你唯一要加入到函数原型中的东西,是有三个东西,一,函数的名字;,返回值,和它的参数。

    哈佛公开课 - 计算机科学课程节选

  • 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 when I'm done, I'm going to give the value back out. All right?

    当它完成计算后,需要返回对不对?

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

  • Now let me spend just a second to say, what was this actually doing?

    如果我在这里这么做-啊,它返回给我了

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

  • minus volatility to plus volatility it will return any value in here.

    浮动到+浮动之间等概率地,去返回一个

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

  • Two, the arguments or parameters, and three, is the return value.

    第二个,参数和参量,还有三,是那个返回值

    哈佛公开课 - 计算机科学课程节选

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

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

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