Python Tutorial #6: Data Structures — Lists, Dicts, Sets, Tuples

In the previous tutorial, we learned about functions. Now let’s learn about Python’s built-in data structures: lists, dictionaries, sets, and tuples. These are the tools you use every day in Python. By the end of this tutorial, you will know how to store, access, and transform collections of data. Lists A list is an ordered, mutable collection. You can add, remove, and change items. fruits = ["apple", "banana", "cherry"] print(fruits[0]) # apple — first item print(fruits[-1]) # cherry — last item print(len(fruits)) # 3 Adding Items fruits.append("date") # Add to end: ["apple", "banana", "cherry", "date"] fruits.insert(1, "avocado") # Insert at index 1: ["apple", "avocado", "banana", ...] fruits.extend(["fig", "grape"]) # Add multiple items to end Removing Items fruits.remove("banana") # Remove by value (first occurrence) last = fruits.pop() # Remove and return last item item = fruits.pop(0) # Remove and return item at index 0 List Slicing Slicing creates a new list from part of an existing list. The syntax is list[start:end:step]: ...

April 25, 2026 · 9 min

Jetpack Compose Tutorial #6: Lists — LazyColumn and LazyRow

Every app has lists. A chat app has a list of messages. A store app has a list of products. A settings app has a list of options. In the old Android world, you used RecyclerView — which needed an Adapter, a ViewHolder, a LayoutManager, and a lot of boilerplate code. In Compose, you just use LazyColumn. That’s it. LazyColumn vs Column — Why Not Just Use Column? You already know Column from Tutorial #2. Why not use it for lists? ...

March 18, 2026 · 9 min