List: playing the array hormone (unfinished)

sequence

1. Members of ordered, and it can be accessed by one or several members of the offset to the next landmark, such a type referred to as sequence.
2. Data type sequence comprising: strings, lists and tuples.
3. Features: membership operator concatenation operator, the operator is repeated, with the slicing operation index

List: playing an array of hormones

List (played array hormone): You can store any type of data sets and.
1. Define an empty list
list defines a containing element 2.
3. Setting List which lists
Here Insert Picture Description
Here Insert Picture Description
feature list 1 Exercise
Title: The season for a given month, the month print belongs.
Tip: 3,4,5 6,7,8 Spring Summer Fall 12, 10, 11, 1, 2 winter
expedition point: a list of the member operators

exercise test as follows:
Here Insert Picture Description
Here Insert Picture Description

**题目:列表特性练习2**
**假定有下面这样的列表:
names = ['fentiao', 'fendai', 'fensi', 'apple']
输出结果为:'I have fentiao, fendai, fensi and apple.'**

练习实验如下:

Here Insert Picture Description
Here Insert Picture Description
Add a list of
list element is added through a append to the list;
list by stretching extend the method to achieve a plurality of elements added to the list
is added at the specified position using the insert element method;
L.insert (index, Object)
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Modify the list
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
to delete the list of
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
list view
to see a list of elements in the table with the index method;
view a number of elements in the list that appears by count method;
Here Insert Picture Description
Here Insert Picture Description
other operations
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_43592835/article/details/90267203