0% found this document useful (0 votes)
2 views1 page

Python Works

A list is a mutable, ordered collection of arbitrary typed objects that can grow or shrink in size. Lists can contain various data types, support indexing, slicing, concatenation, and nesting. They are represented as comma-separated values within square brackets.

Uploaded by

danielmasai033
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Works

A list is a mutable, ordered collection of arbitrary typed objects that can grow or shrink in size. Lists can contain various data types, support indexing, slicing, concatenation, and nesting. They are represented as comma-separated values within square brackets.

Uploaded by

danielmasai033
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

LISTS

A list is a positionaly ordered collection of arbitrary typed objects with no


fixed size. They contain any sort of objects: numbers, strings, and even other
lists. List are also mutable objects (can be modified).

Lists are sequences and therefore can be indexed thus are ordered by positions, you
can also do tasks such as slicing and concatenation.

Lists can grow and shrink in lengths, and are heterogeneous. they also support
nesting (list of lists of lists).

A list is a list of comma-separated values (items) between square brackets as


below.

squares = [1, 4, 9, 16, 25]

Lists can be indexed as follows:

squares[0] # indexing

You might also like