You should be able to maybe print out a blank copy of those notes from the website not for memorizing them, but now just understanding how the photoelectric effect works.
你们应该可以从网站上打印一份,这些笔记中的空白的纸张,不仅仅是为了记忆,而且现在要理解,光电效应是如何工作的。
So let's go ahead and introduce a couple other capabilities so that we can finally start writing programs that maybe print out charts or interact with the user, play games, or the like.
让我们继续来介绍其他几个功能,以便我们最终能开始写程序,那样可以打印图表或与用户交互,打游戏之类的。
In there, I want to make this distinction, this nuance: the evaluator is still going to be taking those expressions and using its rules to get a value, but it's not going to print them back out.
在这里,我想要做这么一个,细微差别:运算器依然会,对表达式,进行求值,但是不会,显示结果值。
I'm going to post it in a format which will be black and white and easy to print out so you don't have to worry about this.
我会把它做成黑白板式上传,方便同学打印,所以完全不用担心笔记问题
What I'm going to ask you to do is track what you're eating, and to go to a website that will allow you to enter all your eating, and then it will print out a dietary analysis of that.
我希望你们能记录每天吃的东西,然后到相关网站输入你的饮食记录,之后打印出饮食分析报告
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.
但是输入不是浮点数的话,我这里就会显示一个消息说,你搞砸了,该稍微有点礼貌吧?,然后我们继续执行循环,一直到得到正确类型的输入。
Let's do a little Copy Paste down here so I can print out its size.
让我再做个复制粘贴,所以我能打印它的大小。
It means anybody using that little function get float doesn't have to worry about what's inside of it. So for example, I decide I want to change the message I print out, I don't have to change the function, I just pass in a different parameter.
这代表着用这个方法去获得浮点数,的任何人都不用担心具体的实现了,例如,如果我想改变下,显示的信息的话,我不必去改变方法,我传个不同的参数就可以了。
I print out -- and this is only wrapping - because of the big font -- I print out, "I demand that you give me a positive integer."
我打印出来--这个字符相互覆盖了,因为用的是大字体-,我打印:“我需要你给我一个正整数“
Right, so here's a little piece of code that's going to print out the smallest value of three.
好,那么这一小段代码,就是会显示出,三个值中最小的来。
I go ahead and print out a small number.
我继续打印一个小数字。
I can print out a string.
我可以显示一个字符串。
Then at the end of the day what you'll get is something that looks like this which will be a whole day's worth of food intake and then this is what I'd like you to print out and then write about in your concept sheets.
一天结束后你就会得到,类似这样的一天食物摄入值,这就是我希望你们打印出来的,并且在你们观点报告中谈论的
As an aside, why are you able to use print F without writing out a prototype for it?
此外,为什么我们不用写printf的函数原型,而可以使用它呢?
And then I'm going to do a similar thing to print things out. But would the solver do?
然后我还是一样要把结果输出来,那solver做的是什么呢?
printf Well, notice I'm calling print F with percent C, and then I'm printing out each of these letters one at a time.
好的,请注意我用%c来调用,然后我打印出一个一个打印出这些字符。
That's the Python saying, that is a command, that is a specific command to get the value of the expression and print it back out.
这代表着Python告诉我们这是一个命令,这是一个,得到表达式的值,并显示的特殊命令。
All right, we're-- well actually, I should say that better, we first check to see, is x 0 greater than or equal to zero, if it's not, then we come down here and we print something out, otherwise we run through a little loop to get the answer, and then we check it and we spit something out.
然后我们运行一个小循环,好了,我们现在来看看,如果x≥0或者x<,我们看这儿,我们会输出一些内容,或者我们运行一个小循环来获取答案,然后我们检验一下,然后得到结果。
Is the first part. That says, I took the branch through here that eventually got to the end and said, there wasn't a solution, in which case I'mgoing to print out, there ain't no solution, otherwise I'll print out the pieces. All right, let's check it out. Ah, what did I say?
我是否返回了特殊的none值?是第一部分,这里的意思是我从这个分支,走到这儿最终走到最后,并告诉我这条路没有解决方案,也就是我想要打印的结果,没有符合的结果,否则我会把它们输出来?
We can put a list in the list again, as we've seen before. So let's put the list containing the string a, and I'll print out so now we see something pretty interesting about a list, that we can mix up all sorts of things in it, and that's OK.
数组放到数组中去,让我们把这个包含,字符串a的数组放进去,然后再显示,我们看到了一些,挺有趣的事情:我们可以把各种,各类的东西混合着放进去,没问题。
But notice what this does. The first thing it does is, it says, let's check and make sure x is greater than or equal to 0. If it isn't, notice what's going to happen. None of that block is going to get executed, and it's going to come down here and print out a useful piece of information, which says, hey, you gave me a negative number. I don't know how to do this.
做的是和以前一样的事情,但是注释它做了什么,第一件做的事情就是,程序说,要去检查并且确信x是大于等于0的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。
应用推荐