Back
+10 XP
Concept

What is a List: Dynamic Arrays

A list is an ordered container defined by square brackets `[]` that holds multiple items of any data type.

python
items = ["dagger", 42, True]
print(items)
print(len(items))  # 3

# 66. What is a List: Dynamic Arrays A list is an ordered container defined by square brackets `[]` that holds multiple items of any data type: ```python items = ["dagger", 42, True] print(items) print(len(items)) # 3 ``` Unlike rigid arrays in C, Python lists automatically resize in RAM and happily hold any mix of data types in one single structure.

Checkpoint

What brackets do you use to create a list in Python?

Practice

Create a list named `loot` containing `"gold"` and the number `100`. Print the list.

Terminal
01
Tap code blocks below to assemble
Available Blocks