Python-3 List

Source: Internet
Author: User
Python listings (list)

A sequence is the most basic data structure in Python. Each element in the sequence is assigned a number-its position, or index, the first index is 0, the second index is 1, and so on.

Python has a built-in type of 6 sequences, but the most common is lists and tuples.

Sequences can be performed by including indexing, slicing, adding, multiplying, and checking the members.

In addition, Python has built-in methods for determining the length of a sequence and determining the largest and smallest elements.

A list is the most commonly used Python data type and can appear as a comma-delimited value within a square bracket.

The data items of a list do not need to have the same type (long described as an array of hormones)

Create a list by using square brackets to separate the comma-separated data items.

the values in the Access list use the subscript index to access the values in the list, and you can also use the square brackets to intercept the characters


Update list

You can modify or update the data items in a list, or you can use the Append () method to add list items


Delete a list element

You can use the DEL statement to delete the elements of a list

python list script operator

The list of + and * operators are similar to strings. The + number is used to combine the list, and the * is used to repeat the list.

Python list interception


python list Functions & methods

The list contains the following methods:



Mind Mapping


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.