• OK, says it says enter a float. I give it something that can be converted into a float, it says fine. I'm going to go back and run it again though. If I run it again, it says enter a float.

    好了,看到他说输入一个浮点,我输入它可以转换为浮点的值,那没问题,我回过来再运行一遍,如果我再运行一遍。

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

  • But that little short hand there is doing exactly the same thing. It is adding that value into some digits and putting it back or signing it back into some digits. And I'll walk through that loop and when I'm done I can print out the total thing does. And if I do that, I get out what I would expect.

    加上得到的这个的,但是这个缩写声明其实是进行了同样的操作,它把我们得到的这个加到一个上面去,然后用和对这个进行了重新赋值,在循环中会去遍历字符串,当完成循环后,程序会显示字的总和,如果我运行,这个程序的话,我会得到我期待的结果。

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

  • And again, if I just run this, just to show that it's going to do the right thing, it says enter base, I'm obnoxious, it says oops, wasn't a float, so we'll be nice about it and I enter a height, and it prints out what I expected. I just concatenated those strings together, by the way, at the end.

    我再来运行下看是不是做对了,提示输入底,噢,它提示说不是浮点,我很高兴,然后我输入一个,浮点作为高度显示结果和我预期的相同,顺便说一句,我只是在最后把这些字符串连接起来了。

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

  • 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
- 来自原声例句
小调查
请问您想要如何调整此模块?

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

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