These things run for variable amounts of time because they take input, a list of size of some amount.
而这一段的执行时间是可变的,因为它们需要输入一个包含一些元素的列表。
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
ArgC How many words were typed at the prompt, by default, Arg C, should always be at least one.
提示符那里默认要输入多少单词,至少需要一个单词。
As an editor, I'm constantly taking all these inputs and deciding on that one or that intersection of a few that makes sense for what we're doing.
作为一个编辑,我不断地吸收这些输入程序,决定哪一点或是哪一部分,是值得去做的。
If we have a higher z effective, it's pulled in tighter, we have to put in more energy in order to eject an electron, so it turns out that that's why case 2 is actually the lowest energy that we need to put in.
而如果有效核电量更高,原子核的束缚也就更紧,我们不得不输入更多的能量来打出一个电子,这就是第二种情况,所需要输入的,能量更少的原因。
So, this is what goes on in an electrolysis cell, and it works thanks to input energy from a power supply shown here.
所以,这是在一个电化学电池中发生的,它是靠输入的能量工作的,从和这个类似的电源输出的能量。
Train schedule, you will be prompted by the newer boxes from where to where.
列车时间表,一个新搜索框会提示你,输入起点与终点。
So, it makes a binary decision, either I create an action potential or I don't, but that decision could be based on many inputs, not just on input from one cell.
所以 这里产生一个二选一的决策,就是产生动作电位亦或不产生,不过这个决定可能是,根据很多输入信号做出的,而不是仅凭单个细胞所传来的信号
Suppose you could build a circuit with the following property: the input to this circuit would be any other circuit diagram.
假设你能用如下物品,建立起一个线路:,这个线路的输入设备,可以是任意一个其他线路的流程。
And they type in "cappuccino" on a little terminal, which is basically a calculator on top of the cash box, and then they get $3.24 from that. They get a receipt.
他们在一个小终端机上输入“卡布奇诺“,那个终端机不过是个收银盒上价格计算器而已,他们划走了3。24美元,打出一张凭条。
I just want to remind you, if I wanted to, for example, type in an expression like that, notice the syntactical form, it's an expression, a number, followed by an operand, followed by another expression.
我想要提醒下大家,如果你想要,例如,输入一个这样的表达式,注意语法形式,这是个表达式,一个数字,后面是一个运算对象,后面是另外一个表达式。
Now, if I've asked the user for a string and then a moment later I ask the user for another string, well, they're going to end up in different locations in memory just by nature of get string.
现在,如果我要用户输入一个字符串,一会儿之后我要用户输入另一个字符串,他们最终是在,不同的内存地址中。
That is the address in memory in the heap of the first byte that the user typed in.
那是用户输入的字符串第一个字节,内存中堆的地址。
You put some inputs in, it has a contract that says if you put the right kind of inputs in you'll get a specific output coming out, but you don't have to know what's inside of that box.
你可以将输入一些内容,它相当于一个条件合约,如果你的输入是正确的,你就能得到特定的输出,但是你不知道盒子里面有些什么。
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.
但是输入不是浮点数的话,我这里就会显示一个消息说,你搞砸了,该稍微有点礼貌吧?,然后我们继续执行循环,一直到得到正确类型的输入。
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.
好了,看到他说输入一个浮点数,我输入它可以转换为浮点数的值,那没问题,我回过来再运行一遍,如果我再运行一遍。
Even though my statement said enter a number, in particular, raw input here simply takes in a set of characters and treats it as a string.
即使我的陈述说的是应该输入一个数字,实际上,这里的原始输入会被当做一个字符,的集合来提取并被当做一个字符串来对待。
And then, if I want to find out if something's there, I do the same thing. But notice now, hash is converting the input into an integer.
然后,我想查找出某些元素是否在列表中,我做同样的事,但是现在注意,哈希是将输入转化成一个整数,所以,其思想是什么?
But if I say turn this into a float, ah it throws a value error exception.
它就会抛出一个值错误异常了,它会告诉我输入了一种错误的值。
ReadFloat We'll look at it in a second. Let me sort of set the stage up for this -- suppose I want to input -- I'm sorry I want you as a user to input a floating point number.
名字叫,我们来看一会,我先来设置下情景-,假设我想输入,抱歉,我希望你们作为用户来输入一个浮点数。
I'm going to run through a loop, and I'm going to request some input, which I'm going to read in with raw input.
我要运行一个循环,我需要一些输入,需要读入一些原始的输入。
For a couple of reasons. In some ways, this would be nicer, do expected cases, it's going to tell you on average how much you expect to take, but it tends to be hard to compute, because to compute that, you have to know a distribution on input.
关注最快的情况,在某种意义上来说,因为一些原因这样想挺不错的,当我们处理一个给定的问题,计算平均时间的时候,是很难计算的,因为你并不知道输入的分布情况,这些输入会是怎么样的呢?
So one of the things I didn't say, it's sort of implicit here, is what is the thing I measuring the size of the problem in?
我有一点没有提及,这有点含蓄,这一点就是我怎么,来度量输入问题的大小呢?,一个数组的大小怎么来定义呢?
STUDENT: So are you entering a tuple in for start and end?
学生:那么你把开始点和结束点,访在一个元组里面输入么?
You could run through a little loop to say keep trying until you get one. But one of the ways I could deal with it is what's shown here.
你可以运行一个小循环来不断地做,直到得到一个输入,但你应该做的是弄明白这里到底要干什么。
The answer was, find a mathematical expression depending on the number of inputs.
很不错,答案是,找到一个通过输入数字,计算出来的数字表达式。
Whoa. What happened? I said enter a number.
噢,怎么回事!我说过我们要输入一个数字。
And what happens the moment I call swap, as I said earlier, you get a copy of the inputs.
当我调用swap时会发生什么,之前说过的,你得到一个输入。
- And now temperature in Fahrenheit -- 212 all right, let's go ahead and pick an easy one like 212, Enter, and indeed equals 100 in Celsius.
现在输入华氏温度-,好的,让我们选一个简单的,像,回车,确实等于100摄氏度。
In a compiled language, you have an intermediate step, in which you take the source code, it runs through what's called a checker or a compiler or both, and it creates what's called object code.
而在编译语言里,你就会经过一个中间的步骤,在这种语言里输入源码后,先经过过滤器,或者编译器检查后,它会创建一个叫做目标代码的东西。
应用推荐