And we're going to start with one that you many of you, have already bumped into perhaps by accident, which are lists.
曾经遇到过的,可能是偶然遇到的类型来开始,就是数组,数组和字符串类型。
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的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
Now, to my knowledge, most implementations of Python use this way of storing lists, whereas Lisp and Scheme do not.
这正是我希望的,据我所知,Python,的大多数实现,都是用这种方式来存储数组的,而Lisp和Scheme则不是。
Append sticks the list on the end of the list, append flattens it, one level of course.
因此串联加操作符和append方法,是不同的,Append方法把一个数组。
And one is the third element. And just return, it's done. It is a palindrome. That make sense.
完成,数组时回文的,这就对了,因为数组1a1从前面和从后面读都是一样的。
OK, for example, I might say point p1 is that list, x is 1, y is 2.
和y坐标的数组是很简单的1,那么,例如,我可能会说点。
I think I wrote this down carefully so I would make sure I did it right.
好,假设实际上这个数组,并不是x坐标和y坐标的表示。
All right? Now, I'll say L 2 equals L 1.
好,然后我新建个L2数组和L1相等。
So I can concatenate techs plus ivys and assign that result to univs, and then when I print it you'll notice I just get a list of five strings.
和ivys数组用加号串联运算,并把结果赋值给univs数组,接下来我显示下univs的结果,你注意到我得到了一个。
应用推荐