One ParasolOne Parasol

Lists and Tuples - Working with Collections

Understand Python's fundamental collection data types

Lists and Tuples - Working with Collections

📚 Resources for This Lesson

Lists

Lists are mutable collections of items.

# Creating a list
fruits = ["apple", "banana", "cherry"]

# Accessing elements
print(fruits[0])  # apple

# Adding elements
fruits.append("date")

# Removing elements
fruits.remove("banana")

# List comprehension
numbers = [x**2 for x in range(5)]

Tuples

Tuples are immutable collections of items.

# Creating a tuple
coordinates = (10, 20)

# Accessing elements
x, y = coordinates

# Tuples are immutable
# coordinates[0] = 30  # This will raise an error

Common Methods

List Methods

Useful Functions

← Back to All Lessons💻 Try Live Editor
Copyright © 2026. Made with ♥ by OneParasol Illustrations from