🐍 List

list

Creating Lists

nums = [1, 2, 3]
names = ["Jim", "Tom", "Sara"]
mixed = [1, "hello", True]

Empty List

items = []
items = list()  # same result

Manipulate List

Lists can be manipulated in various ways: 🐍 String & list manipulation


Looping Through a List

Find here how to loop through a dictionary: Looping Through a List