Python built-in function (--list)

Source: Internet
Author: User

English documents:

class list ([iterable])

Rather than being a function, is list actually a mutable sequence type, as documented in Lists and sequence types-list, Tuple, Range

Description

1. The list function, which is actually the constructor for the list type above.

2. You can not pass in any parameters, and the result returns an empty list.

>>> a = list ()>>> a[]

3. You can pass in an iterative object, such as a string, a byte array, a tuple, a list, a Range object, and the result will return a list of elements in an iterative object.

>>> List ('ABCD')#string['a','b','C','D']>>> List (bytes ('ABCD','Utf-8'))#byte array[97, 98, 99, 100]>>> List ('a','b','C','D'))#Meta-group['a','b','C','D']>>> list (['a','b','C','D'])#List['a','b','C','D']>>> list (range (1,5))#Range Object[1, 2, 3, 4]

Python built-in function (--list)

Related Article

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.