17: neutron list access list

1: What is the word list?

(1) above, we learn, through specific numbers, access data in the list.

(2) if we need is not a data, but a set of data, then we will consider re-extract a new list. This list is drawn up on the basis of the original list. We believe that this new list is sub-lists.

2: sublist Notes: If the l [ 'Wu Jun', 'Chan', so 'Li Po', 'chuanjiao', 'ZHIMING'], if we have a list of five such data.

(1) [0: 2] and [; 2] effect is the same, can intercept data numbers 0 and 1. You must remember, intercepted data does not contain data used by the end of the index.

We extract wherein A & apos Wu Jun ',' Chenhang ',, which is a list of two data 0 + 1, we give a new list, called list1 = [0: 2], the final reason is not 2 1, because, at the end of data to subtract 1.

We extracted wherein B 'of Wu Jun', 'Chenhang' ,, which is a list of two data 0 + 1, this can also be expressed. 0 can be subtracted. Can be expressed this way [; 2], so that only a specified end, from the very beginning of execution on it . [0: 2] and [; 2] effect is the same. We do not write the beginning of the index, then, it is the default from the beginning to write. If we do not write the end of the index, then it defaults to the end of the list.

(2) If we want to get the [1: 3], so we intercepted the list of No. 1 and No. 2 data.

(3) If we want to start from the No. 2 data interception, until the end, we can use [2:] the way to intercept.

(4) If the list does not write the beginning nor the end of writing the words of [:], we copy the entire contents of the equivalent list.

 

3: We now perform about our data

 

Published 45 original articles · won praise 0 · Views 478

Guess you like

Origin blog.csdn.net/tainwaifeixian/article/details/104614049