๐Ÿ PyQuest๐Ÿงบ Lists & Collections ยท ๐Ÿงบ Lists: A Basket of Stuff
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

Lists: A Basket of Stuff ๐Ÿงบ

A variable holds one thing. But what if you have a whole squad?

A list is one variable that holds many things. You make one with square brackets [ ] and commas between the items:

snacks = ["popcorn", "grapes", "cheese"]
print(snacks)      # โžœ ['popcorn', 'grapes', 'cheese']

Lists can hold numbers too:

lucky_numbers = [7, 13, 21]

Notice that printing a whole list shows the square brackets and quotes. That's Python saying "here's the whole basket!"

Your mission

  1. Make a list called squad with at least 4 names in it
  2. Make a list called snacks with at least 3 snacks in it
  3. Print both lists

Your code

Press โ–ถ Run to see what your code does!