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

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

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

  • At least you maybe finding that and if not when you look back at the code you then have written you'll realize that in fact it just requires a few lines of code.

    至少你会发现一点,不然的话,在你写完代码,返回去,看的时候你会意识到,实际上它只需要几行代码。

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

  • Do one comparison and return one of two possible orders on it, but I need to decide that.

    虽然可以做一次比较,然后返回两个可能的顺序中的一个为结果,但是需要我来做决定。

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

  • Is it one basically? In which case, just return a copy the list. That's the simple case.

    是最基本的情况吗?在种情况下,仅仅返回一个列表的拷贝,是简单的情况。

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

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

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

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

  • So that's the second thing I've just highlighted here, is that I now have the ability to check whether it does the right thing.

    你知道的,一个虚数,但是返回虚数就没有什么价值了,那么是我想要强调的第二件事情。

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

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

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

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

  • In either event, if I'm looking at the last element, I return.

    两种情况中,如果是最后一个,元素的话我就返回

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

  • So, I said, okay, I didn't want to assume so we clicked senior and frankly it was then a dead end because apparently to get some senior discount you need to have some special pass or something like this that we didn't have and yet that certainly wasn't obvious here so now we together and this person in particular had to figure out how you go back and then restart this process.

    我说,好的,我不希望揣测,所以我点击了老人票,然后问题就来了,因为似乎,需要特殊的号码之类的东西来购买老年票,但是我们没有,明显我们不应该走步,现在我们一起必须找出,怎样返回,然后重新开始个步骤。

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

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

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

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

  • I don't happen to like this, but he thinks that is, give a combination of a number multiplication in a string, this will in fact give us back a new string with that many replicas, if you like, of the string concatenated together.

    我不喜欢么做但是他认为,也就是说,返回一个字符串的,某个特定数字的倍数,实际上会返回一个新字符串,一个原来的字符串的很多复制品,连接到一块的一个字符串。

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

  • OK. Note, by the way, if I chase through each possible path, like there's some IFs in here, if there's some places to go, at least in this piece of code, every possible path through this code ends in a return. And that's a good programming discipline, to make sure that happens.

    注意一下,如果我跟进每一条可能的路径,像是里的,起码在段代码中就有很多走向,段代码中的每一条可能路径,在结尾都会返回一个值,就是一条很好的编程定律,请确保样做。

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

  • x and get the values of x and y attached to this thing and return them to me.

    和y值然后把它们返回给我,It’s,going,to,go,off,就是我想要的东西,我想要我的类里面有一些方法。

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

  • So, after the second line for code here char * s1 gets the return value of get string this is what the state of our world looks like.

    在第二行之后,个代码char,*s1,等于GetSting的返回值,就是它看起来的状态。

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

  • X I'm passing an X, and yet I'm also assigning the return value to X. So just intuitively what's going to be the effect of this one line of code?

    我传一个X,之后我把返回值赋值给,很明显,一行代码,将会产生什么作用?

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

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

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

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

  • 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的话,也就是说数组中的元素小于等于,我对两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先个指向一个列表的开头。

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

  • But I can also ask for parts of this. So I can, for example, say give me the first element of s1 string 1, s 1. Ah, that's exactly what we would have thought if this was represented as an ordered sequence of things.

    然后返回一个长字符串,我也可以,取字符串的一部分,例如,我可以要求返回给我字符串,的第一个元素,啊,证明我们之前,认为的它是一个有序的字符序列的想法。

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

  • That's the internal representation that python uses for this. If I give it some other character, yeah, it would help if I could type, give it some other character.

    为什么输入‘3’返回了其它的东西?,是python在内部的表示方式,如果我输入其它的字符,是的,如果我能输入,输入其它的字符。

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

  • And it treats it as a string, it's simply getting me back 52*7 the value of that string, 52 times 7, rather than the value of it.

    让Python把它当做字符串来对待,他返回给我了,一个字符串的值,而不是个数的和。

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

  • > So void, again, is my way of saying swap does not return anything.

    >,void,再次强调下,是一种,说明函数不返回任何值的方式。

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

  • Now, the one that we're most interested in ANS is the one where, in fact, it gets out ANS, so you see down here in the code, there's a spot where it's going to return the value of ANS, which is what we want, right? That's the thing that holds the value that we intended to have.

    现在我们最感兴趣的是个,事实上它返回的是,所以你看段代码,在返回ANS值,也就是我们想要的,对吧?,它就承载了我们想得到的值。

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

  • So with the fact that I'm now just back at my prompt is a good thing so now GCC hello c if I type this command GCC hello.c, this is gonna run this program that Apple wrote in this case GCC or someone else wrote called GCC.

    也就是说我们现在安全返回,说明一切正常,现在我输入条命令:,代表运行hello,c个程序,是由“Apple“或其他人编写的,名为。

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

  • Another way of saying it is, I've actually said, what did I use there, and , It's basically saying there is the first point, there's the second point, add them together and I get that point.

    我要去做的是-对不起,再运行一次-好,你可以看到我已经把,两个点的坐标值加到一块儿了,然后返回了r的值,我会让大家看到我们,实际上得到的是什么,看起来不错,好,我做了正确的操作。

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

  • - So now if Christiana doesn't actually -- if either programmer or who's programming these little puzzle pieces, don't actually do anything with this return value, and I call, get int, she wants to hand this piece of paper -- to me, but if I don't actually assign -- no, no, I just messed up the demo.

    现在如果Christiana没有-,如果程序员或谁在编写段代码,不要对返回值做任何事情,我调用GetInt,她把张纸给我,但是如果我没有赋值-,不,不,我刚才把个演示搞乱了。

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

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

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

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