• So it's a way of reminding you, I've got to be careful about the types of things that I put in.

    因此我这是在提醒你,一定要对输入的东西的类型,多加注意。

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

  • We saw, associated with that primitive data, we have ways of taking data in and creating new kinds of data out, or new versions of data out, so we have operations.

    我们可以取得输入的数据然后,创建新的类型的输出数据,或者新的版本的输出数据,这就是我们说的操作。

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

  • You have to be ever so explicit as to what data type your actually passing in.

    你必须很清楚,你们输入的参数是什么类型的。

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

  • But if it is not, it's going to print out a message here saying, you screwed up, somewhat politely, and it's going to go back around. So it'll just cycle until I get something of the right type.

    但是输入不是浮点数的话,我这里就会显示一个消息说,你搞砸了,该稍微有点礼貌吧?,然后我们继续执行循环,一直到得到正确类型输入

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

  • What does it do? It has height, it says, I've got two names of things: the request message and the error message.

    那它是用来干嘛的呢?,它声明了包含两个对象:,要求输入的信息和输入类型错误信息。

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

  • The second thing is, what do I print out if I actually don't get the right input in?

    第二件事是我没得到,正确类型输入时输出什么?

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

  • It's going to do a lot of type checking for you before it actually passes things back.

    它会在将输入值进行计算之前,做很多类型检查。

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

  • And given those types of input, will get back output.

    然后鉴于输入类型返回结果输出。

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

  • So, summarizing better, assert is something you put in to say to the user, make sure you're giving me input of this type, but I'm going to guarantee you the rest of the code works correctly. Exceptions and exception handlers are saying, here are the odd cases that I might see and here's what I'd like to do in those cases in order to try and be able to deal with them.

    所以更好的总结下,断言就是你放在那里告诉用户,保证你输入的是这种类型的,但我能保证剩下的代码运行正确,异常和异常处理做的事,这里有些我能预期的异常情况,并且这里有些情况,我能尝试处理。

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

  • So input is an int called F, print out to the screen or your piece of paper the value of C. Odds are you only need two, maybe three lines of code for this, but the goal ultimately will be try it on your own.

    所以输入是一个int类型的F,在你的屏幕上,或你们的纸上打印出C的数值,可能你们需要两行或者三行的代码,但是最终的目标需要你自己独自尝试。

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

  • And then I run a loop in which I read something in, I check to see if it's the right type, if it is, I change that variable to say it's now the correct type, which means the next time through the loop, I'm going to say I'm all set and I'm going to bounce out.

    因为我还没输入,然后我运行一个循环,循环内部我输入一些东西,然后看看是不是正确的类型,如果是的话我改变input,Ok为真,来证明输入数是正确的类型,这就意味着下一次运行这个循环的时候,就可以跳出循环继续执行了。

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

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

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

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