132.1 Lists
Learn how to use lists to store and manipulate multiple values in a single variable.
What is a list?
SET example_list TO LIST ["Alice", 10, TRUE]# A string, an integer, and a Boolean in one list
example_list = ["Alice", 10, True]Creating a list
SET names TO LIST ["Lina", "Ari", "Noah"]names = ["Lina", "Ari", "Noah"]Accessing and modifying list items
SET names TO LIST ["Lina", "Ari", "Noah"]
OUTPUT names[0] // Lina
SET names[1] TO "Aria" // LIST ["Lina", "Aria", "Noah"]names = ["Lina", "Ari", "Noah"]
print(names[0]) # Lina
names[1] = "Aria" # names = ["Lina", "Aria", "Noah"]Adding and removing items
Looping through a list
Useful list functions and methods
Task
Python
Pseudocode
Key concepts
Last updated
Was this helpful?