To create an empty list, we code [
and ]
.
todo = []
print(todo)
Placing a string between the brackets creates a list with one value, like here with ["Coding"]
.
todo = ["Coding"]
print(todo)
We use commas ,
to separate two or more values in a list, like "Read"
from "Workout"
.
todo = ["Read", "Workout"]
print(todo)
Any number of values of any type fits in a list. We add more by coding a comma and the value.
todo = ["Read", "Workout", "Code"]
print(todo)