And again, this points out something I wanted to me-- I mentioned last time, list can be heterogeneous, in the sense that the elements can be multiple different types.
这儿又指出了一点我想要告诉大家的,我上节课也提到了,就是数组是多相的,也就是说元素可以是多种类型的。
And we're going to start with one that you many of you, have already bumped into perhaps by accident, which are lists.
曾经遇到过的,可能是偶然遇到的类型来开始,就是数组,数组和字符串类型。
Right, and just to get a sense of this, let's look at a simple little example, so on your hand-out, you'll see I've got a little piece of code that says assuming I've got one of these points, I want to do things with it, for example I might want to add them together.
这些数组中的一个,你怎么能够知道,它是哪种类型的呢?,你怎么知道它是以笛卡尔坐标,表示的还是以极坐标,形式表示的呢?,你没有可以用来区分的东西,你没有说明这种信息,聚集实际上的意义。
As a consequence, I have a list of ints.
是由integer类型组成的数组。
应用推荐