Python Language List: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 4: Line 4:
=Overview=
=Overview=
A list is a mutable [[Python_Language#Sequence_Types|sequence type]] that contains zero or more elements and whose elements can be of different types.
A list is a mutable [[Python_Language#Sequence_Types|sequence type]] that contains zero or more elements and whose elements can be of different types.
=Access to a List=
==Size of a List==
The number of elements is given by the <code>len()</code> function:
<syntaxhighlight lang='py'>
l = [...]
print(len(l))
</syntaxhighlight>


=Organizatorium=
=Organizatorium=

Revision as of 02:45, 17 February 2022

Internal

Overview

A list is a mutable sequence type that contains zero or more elements and whose elements can be of different types.

Access to a List

Size of a List

The number of elements is given by the len() function:

l = [...]
print(len(l))

Organizatorium

l.append()