Python list method(1)
> my_list = ["one","two"]
> my_list.append("three")#["one","two","three"]
Add an item to the end of the list. Equivalent to a[len(a):] = [my_list].
> my_list.remove("two")#["one","three"]
Remove the first item from the list whose value is equal to "twp".
> my_list.extend([1,3])#["one","three",1,3]
Extend the list by appending all the items from the [1,3](iterable). Equivalent to a[len(a):] =
[1,3]
> my_list.pop(2)#["one","three",3]
Remove the item at the given position in the list, and return it.
If no index is specified, my_list.pop() removes and returns the last item in the list.
> my_list.clear()#[]
Remove all items from the list. Equivalent to del my_list[:].
> my_list.insert(0, "haha")#["haha"]
Insert an item at a given position. The first argument is the index of the
element before which to insert, so a.insert(0, x) inserts at the front of the list,
and a.insert(len(a), x) is equivalent to a.append(x).
It raises a ValueError if there is no such item.
> my_list.append("three")#["one","two","three"]
Add an item to the end of the list. Equivalent to a[len(a):] = [my_list].
> my_list.remove("two")#["one","three"]
Remove the first item from the list whose value is equal to "twp".
> my_list.extend([1,3])#["one","three",1,3]
Extend the list by appending all the items from the [1,3](iterable). Equivalent to a[len(a):] =
[1,3]
> my_list.pop(2)#["one","three",3]
Remove the item at the given position in the list, and return it.
If no index is specified, my_list.pop() removes and returns the last item in the list.
> my_list.clear()#[]
Remove all items from the list. Equivalent to del my_list[:].
> my_list.insert(0, "haha")#["haha"]
Insert an item at a given position. The first argument is the index of the
element before which to insert, so a.insert(0, x) inserts at the front of the list,
and a.insert(len(a), x) is equivalent to a.append(x).
It raises a ValueError if there is no such item.
Last one:Burn it down
Next one:【追光者】拼音
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
Hot degree:★☆☆☆☆
Difficulty:☆☆☆☆☆
quality:★☆☆☆☆
Description: the system according to the heat, the difficulty, the quality of automatic certification, the certification of the article will be involved in typing!
This paper typing ranking TOP20
登录后可见
用户更多文章推荐
- 我们的认识如何构建2021-12-22
- Arch?2021-07-12
- o_O2021-07-12
- 哥林多前书13章4-8节(圣经)2021-01-30
- Nucleus(细胞核)2021-01-29
- A sea dirge(poem)2020-08-22
- 英文小说段落(3)2020-08-22
- 英文小说片段(2)2020-08-19
- 递归以及其利弊(1)2020-08-18
- 英文小说段落(1)2020-08-18
- 10 Bible Verses on Salvation 12020-08-18
- 奥古斯丁忏悔录【卷二】12020-07-05
- 床前明月光2020-07-02
- Python class 52020-06-15
- Python class 42020-06-13
- Python class 32020-06-13
- Python class简介22020-04-29
- Python Class简介12020-04-29
- 圣经-歌罗西书-3章(1-17节)(英文)2020-04-20
- 圣经-传道书-11章-英文2020-04-17